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

Improve discoverability of configurable sniffs / public member vars #1278

Closed
jrfnl opened this issue Jan 17, 2017 · 7 comments
Closed

Improve discoverability of configurable sniffs / public member vars #1278

jrfnl opened this issue Jan 17, 2017 · 7 comments

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Jan 17, 2017

Currently to find out if a sniff has any configuration options, one has to look at the sniff files themselves.
In my experience, this results in a lot of people not knowing about the fact that some sniffs can be configured, let alone, using these features.
And for people who have PHPCS installed as a phar file, looking at the source code is not even an option (unless they look at it here).

I believe a wiki page could help improve the discoverability.

Would you interested in adding a wiki page with a list of the current properties per standard ?

I'd be willing to put in the work to try and gather the information for the page.

Related to #1140

@gsherwood
Copy link
Member

I've wanted to do this for a while, ideally using a script, but I was also planning that the Doc Generator stuff could be used as well. Manually putting it all together and making it useful with examples would be a big task, but it would be a great resource and I'd certainly add it to the wiki.

But I think it's something that really requires a full doc of every included sniff, what they do, how to include them in a ruleset, how the configuration options change that behaviour, and examples of how to set those options in a ruleset. It's a big job.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 18, 2017

It's a big job.

I'm fully aware of this, but am willing to put in the time. I might not be able to get everything done in one go, but will keep you informed of progress.

What about if I put work in progress in a gist for feedback (and easy copy/paste to the wiki) ?

I've just finished preparing the same for the WP coding standards (not yet online as I've been cleaning things up which I came across while doing it, waiting for the merges before publishing).
If you like, I'll put a link up to the end result of the WP version once it goes online.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 19, 2017

Update: That was surprisingly less painful than expected. I've finish creating the list, will tidy up later today or tomorrow and put a draft online.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 28, 2017

Ok, tidying up took a bit more time, but you can find the page I've prepared for the wiki here:
https://gist.github.com/jrfnl/ff1555af507a03f3df00462b94d029ab

It's completely up to date up to the latest commit 8120537 and already includes the proposed new properties as per PR #1318

Feedback welcome.

@gsherwood
Copy link
Member

Oh wow! You're amazing.

I got inundated with PHPCS issues over the last few days so I haven't looked at this properly yet, but I promise I'll get this committed as soon as I can.

Thanks so much.

@gsherwood
Copy link
Member

I've added the wiki page here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties

I still need to go through it properly, but I think it would be easier to manage for me, and link to, if each sniff was broken out rather than grouping properties together when they have the same name. So I might make that specific change, and rework the tables from that so they fit within Github's incredibly narrow window.

Thanks again.

@jrfnl
Copy link
Contributor Author

jrfnl commented Feb 7, 2017

Hi @gsherwood Thanks for that. If there's anything I can do to help, let me know.
I grouped the properties together where relevant as the descriptions would be the same and the document would get very repetitive otherwise, but please change it to your liking as - considering the wiki is not publicly editable -, the brunt of the maintenance will fall down on you, so whatever is best for you.

Hope people will find this addition to the wiki useful.

P.S.: please note that the document already contains the properties from PR #1318 which hasn't been merged (yet).
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties#codeanalysis-unused-function-parameters

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