get-woke / woke

Detect non-inclusive language in your source code.
https://docs.getwoke.tech
MIT License
454 stars 61 forks source link

Feature Request: Woke understanding projects / .wokeignore etc #98

Closed cognitivegears closed 2 years ago

cognitivegears commented 3 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When trying to scan complex or multiple projects, it would be nice to be able to specify ignored files at a subdirectory level rather than just at the root directory. Also, it isn't possible to run woke from a subdirectory and still use the project .wokeignore. i.e. if you change directory into a subdirectory, then run "woke .." it runs for the parent directory but uses the .wokeignore from the subdirectory (or none if the subdirectory doesn't have it)

Describe the solution you'd like A clear and concise description of what you want to happen.

Woke should have the idea of a "project", using the SCM files (.git, etc) similar to how other similar text tools operate (ripgrep, the_silver_surfer/ag, etc.) This could then be used to pull project level .wokeignore files regardless of the current working directory. .wokeignore files for subdirectories should also be supported for complex projects or when running at a higher directory level for multiple projects at once.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

As an alternative, the project could just utilize .wokeignore for each current working directory, without the idea of a project. However, this would still limit executing from a subdirectory taking into account project level .wokeignore items, though it would likely be faster to implement.

Additional context Add any other context or screenshots about the feature request here.

I'm trying to use woke against multiple projects at the same time. The workflow is more convenient to just run against the whole set and fix one a time rather than keep track of each project individually. Unfortunately, when I run at the higher level the project .wokeignore files are ignored. On the other hand, when I go into each project to fix something, I'd like to run woke in that directory to verify the fix, however it then ignores the higher level .wokeignore at the project level as well. I believe the proposal above would make that type of workflow easier and faster.

Thanks for the consideration!!

caitlinelfring commented 3 years ago

I like the idea, would be happy to consider a PR if anyone is interested in tackling this.

caitlinelfring commented 2 years ago

@cognitivegears Are all your use-cases handled by the addition of nested ignore files in v0.18? https://docs.getwoke.tech/ignore/#nested-ignore-files