-
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
Multiple Config loading does not apply rulesets the same way #2675
Comments
Related #2197 ? |
I'm pretty sure I could change But it obviously changes the PHPCS API, so I can't make this change before 4.0 |
Ok, I will be patient, it works with my patch so it is not blocking. |
I've now made this change in the 4.0 branch and can confirm your original code snippet works as expected. |
I wonder whether this change will break sniff unit tests which test sniffs with different config settings. Also see #2899. |
The tests use a single config object, so they should still be working ok. Plus, they can (and do, for PHPCS tests at least) modify the Config object directly. If the tests used multiple Config instances, they should be suffering from the problem described here - that setting the config values doesn't do anything the second time because PHPCS has already recorded that the value has been overridden. So I think that this change would allows more flexibility when it comes to setting config values during testing, although I don't have a use case for it yet. |
I have goe a ruleset.xml file with this line :
<arg name="tab-width" value="4"/>
If il load the Config twice, they will not both have this rule : the first yes, the second not :
I patched it with this one, but it is a dirty patch to ensure my Config object initializes always the same way :
The text was updated successfully, but these errors were encountered: