Skip to content

Implementing walk #2

@thatch

Description

@thatch

An additional function that would be really helpful to have here would be a generator function that calls os.walk on a path, apply includes/excludes, and yields the resulting paths.

Something like

tuber.walk(root: Path, includes: Iterable[str]=("*.py",), excludes: Iterable[str]=(".git", "*.ext.py"))

For this issue

  1. Implement walk using an API similar to the above
  2. Bonus points for defaulting excludes to the same as black uses
  3. Make sure there's a test
  4. Submit a PR!

Quick development instructions

  1. git clone clone https://github.com/python-packaging/tuber
  2. cd tuber
  3. make venv
  4. source .venv/bin/activate
  5. make test (runs unittest)

Make sure the code is formatted (make format) and types are good (make lint) before submitting a PR to save iteration time waiting on CI.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions