-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 suggestion: --space-indent=# command line option #2229
Comments
I really like the idea of being able to batch-set the value of a sniff property. The bit that worries me is that this relies on a convention rather than a built-in feature, like tab-width is. Maybe the solution here is to allow sniff properties to be defined on the command line more generally? |
Well, within WordPressCS there are a number of sniffs for which we have implemented this using We have implemented this based on feature requests, specifically for the recommended properties, such as All the same, I think the I like the idea of being able to set properties from the command line as a standard feature though, though implementing that will probably be more involved than what I had in mind originally. |
I'm going to close this issue. People can set the property for all sniffs in one go by using: <rule ref="Standard">
<properties>
<property name="indent" value="4"/>
</properties>
</rule> This already worked previously, but will work more cleanly since #3629. The only caveat is sniffs which have a public property called |
PHPCS contains a number of sniffs which have a public
$indent
property (or similar).If the standard of 4 space indents is used, all is fine. However, for non-standard space indenting, it is not always clear for people for which sniffs this property needs to be set, no matter that all the properties are outlined in the wiki.
Would it be an idea to add support for a
space-indent
command line option which would then be respected by all the PHPCS native sniffs which support the property ?External standards could choose to add support for the command-line option as well if they have sniffs with a similar property.
@gsherwood Does this sound like a good idea ? If so, I'd be willing to have a go at adding this.
The text was updated successfully, but these errors were encountered: