Skip to content
New issue

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

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

Already on GitHub? # to your account

How to ignore subpath of scanned code? #3859

Closed
jeritiana opened this issue Jul 25, 2023 · 3 comments
Closed

How to ignore subpath of scanned code? #3859

jeritiana opened this issue Jul 25, 2023 · 3 comments

Comments

@jeritiana
Copy link

jeritiana commented Jul 25, 2023

I get the --ignore flag and I've read Advanced-Usage#ignoring-files-and-folders, but I don't see how to ignore a subdirectory of the scanned code.

Example:

$ phpcs --ignore=/path/to/code/libraries/* /path/to/code

This still scans /path/to/code/libraries/db_errors.php (there are bunch of files, not only a single one, so // phpcs:ignoreFile would not be a viable option).

Thanks!

@fredden
Copy link
Contributor

fredden commented Jul 25, 2023

Perhaps you want the -l flag ("Local directory only, no recursion")?

Looking at the example in the linked documentation, you may want phpcs --ignore=/libraries/* /path/to/code, but I've not tested this myself. Can you report back if this behaves any differently for you?

@jrfnl
Copy link
Contributor

jrfnl commented Aug 9, 2023

@jeritiana Did the above solve your issue ? If not, please report back. If it did, please close this issue.

@jeritiana
Copy link
Author

I believe there was some kind of issue on my setup, it is working now. No specific resolution or something. Thanks for your help

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants