Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cognitivegears opened this issue Jul 9, 2021 · 2 comments
Closed
Labels
enhancement New feature or request help wanted Community help is welcome

Comments

@cognitivegears
Copy link
Contributor

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
Copy link
Member

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

@caitlinelfring caitlinelfring added the help wanted Community help is welcome label Jul 20, 2021
caitlinelfring pushed a commit that referenced this issue Mar 18, 2022
**Please check if the PR fulfills these requirements**

- [x] The commit message follows our [guidelines](https://github.com/get-woke/woke/blob/main/CONTRIBUTING.md)
- [x] Tests for the changes have been added (for bug fixes / features)
- [x] Docs have been added / updated (for bug fixes / features)


**What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Feature


**What is the current behavior?** (You can also link to an open issue here)
Woke currently only looks at .gitignore and .wokeignore files in the current directory.


**What is the new behavior (if this is a feature change)?**
Woke will now traverse a repo and build a priority ranked list of ignore rules in exactly the same way that git does for .gitignore files at different directory levels. The tool will look for the root git directory (where the .git folder is) and use that for the root. If no root git directory is found then woke will just run with the current directory as root (still traversing children folders).


**Does this PR introduce a breaking change?** (What changes might users need to make due to this PR?)
No

**Other information**:
Addresses #98
@caitlinelfring
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Community help is welcome
Projects
None yet
Development

No branches or pull requests

2 participants