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: --include-paths #2123

Closed
devtooligan opened this issue Sep 8, 2023 · 3 comments
Closed

Feature request: --include-paths #2123

devtooligan opened this issue Sep 8, 2023 · 3 comments
Labels
enhancement New feature or request High Priority

Comments

@devtooligan
Copy link
Contributor

devtooligan commented Sep 8, 2023

Describe the desired feature

Opposite of --filter-paths. Slither will only be run on paths matching the regex values of this --include-paths clarg. Or maybe it's "only-include-paths" for clarity. Maybe it should throw if user selects both include-paths and filter-paths as it doesn't seem like it would be needed and it can be difficult to try and incorporate both.

This is useful, for example on an audit of a large repo but the scope is only on certain files.

As a hack, I just altered the current behavior of --filter-paths and it worked as I had hoped:
Screenshot 2023-09-08 at 11 24 45 AM

@devtooligan devtooligan added the enhancement New feature or request label Sep 8, 2023
@0xxfu
Copy link
Contributor

0xxfu commented Sep 23, 2023

+1

@dokzai
Copy link
Contributor

dokzai commented Oct 7, 2023

Hello! I am interested in helping with this issue if help is wanted.

@bohendo
Copy link
Contributor

bohendo commented Feb 20, 2024

As a workaround in the meantime, we can use the regex ^(?!.*<target>) to filter out anything that doesn't start with our target path

eg --filter-paths='^(?!.*the/only/path/i/care/about),tests' will filter out everything that is not inside the/only/path/i/care/about and also filter out the/only/path/i/care/about/tests

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

No branches or pull requests

5 participants