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

Explicitly say that CLI --exclude option disables only 3-part codes, entire sniffs, not 4-part ones #536

Closed
1 of 2 tasks
arsel-5lvxa7b1 opened this issue Jul 9, 2024 · 4 comments

Comments

@arsel-5lvxa7b1
Copy link

arsel-5lvxa7b1 commented Jul 9, 2024

Is your feature request related to a problem?

Hello, IDK if it's the right place for me to talk about this, but we use phpcs without ruleset.xml and couldn't figure out why a 4-part code exclude wasn't working. The error message only says about rule not being found.

Describe the solution you'd like

Explicitly say in wiki and in CLI help that --exclude option doesn't work with 4-part codes.

To be frank, our version of phpcs is quite old (3.4.0) so it may be fixed in newer versions, but I only could find about it from this comment in old repo:
squizlabs/PHP_CodeSniffer#1755 (comment)

This could save others time to find out why their exclude is not working.

@jrfnl
Copy link
Member

jrfnl commented Jul 9, 2024

Thanks for opening this issue, but the first thing to do is upgrade to a more recent version of PHPCS.

This sounds like a duplicate of #319. The information in the wiki was improved as a result of that issue, as well as the help screen (#328).

Additionally, @fredden is working on making the error message shown more informative in #344.

@arsel-5lvxa7b1
Copy link
Author

arsel-5lvxa7b1 commented Jul 11, 2024

@jrfnl while I agree with this, the error was very hard to Google. Maybe I should've read the wiki yes, but without pointing out the specific section, in advanced usage nonetheless (I wouldn't consider it advanced btw), it's hard to find it for me.

My user story is like this: see error, wonder why it's invalid, Google it, can't find my use case, go to github, usage is in wiki, search by exclude, nothing comes up aside from the console help. Continue googling, trying to change the search query, until I find the issue I mentioned.

Even when I went to advanced usage now (btw hard to find that page on mobile), I couldn't make out which section do I need. Limiting results to specific sniffs sounds like an include list only.

After the error text change it could be easier to find why, I agree. And I know how hard it is to maintain open source projects :D

Edit: also I only found out the existence of sniff codes and error codes in that issue. I wanted to fix the error our client has in their repo. I think if I didn't look for it hard enough, it would've stayed that way, without excluding the error code.

@jrfnl
Copy link
Member

jrfnl commented Jul 11, 2024

@arsel-5lvxa7b1 I hear you and improving the error message, as per #344, is a "blessed task", so once the work on that is finished, it will be merged and included whichever release we're at by that time.

Having said that, I understand your inclination to use a search engine to find answers, but the GitHub website is not super-SEO friendly (which is outside my control), so I'd always recommend checking the project documentation (README/wiki) first.

If the documentation can be improved, I'm happy to accept suggestions, but the prerequisite for that will always be reading the docs first....

@arsel-5lvxa7b1
Copy link
Author

arsel-5lvxa7b1 commented Jul 12, 2024

Alright, let's close this then, if I'll have an idea how to improve the wiki, I'll do a pull request, assuming I'll have the time :D

Edit: hmm, maybe add a question to the FAQ and add link to FAQ in the README.md?

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

No branches or pull requests

2 participants