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

PHPCS: document run parameters in project ruleset #107

Merged

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Jan 15, 2020

This makes it easier for contributors to run the PHPCS command for the project.

Includes:

  • Adding the Tests directory to the run - excluding the test case files in fixtures.
  • Cleaning up the result report by using the basepath configuration.
  • Making the run faster by using parallel scanning if available,

@sirbrillig
Copy link
Owner

Nice! I didn't know about those options. Thank you.

@sirbrillig
Copy link
Owner

Hm... I just got the CI tests to run on contributor PRs and this one fails for php7 with

Script ./vendor/bin/phpcs --standard=./VariableAnalysis handling the lint-self event returned with error code 3

This makes it easier to run the PHPCS command for the project.

Includes:
* Adding the `Tests` directory to the run - excluding the test case files in `fixtures`.
* Cleaning up the result report by using the `basepath` configuration.
* Making the run faster by using `parallel` scanning if available,
@jrfnl
Copy link
Collaborator Author

jrfnl commented Jan 17, 2020

Hm... I just got the CI tests to run on contributor PRs and this one fails for php7 with

Hang on, yes, that's my bad, though probably fails on PHP 5 too, but may do so silently.

There are two ways to solve this, but I need some input to know which to use:

  1. The lint-self command doesn't use the phpcs.xml.dist file, but points to a standard, so I could add the command line arguments back.
  2. I could remove the lint-self command and just add the VariableAnalysis standard to the phpcs.xml.dist file. That way there will be only one PHPCS run which does everything in one go.

@sirbrillig Have you got a preference ? I'd recommend option 2.

@jrfnl jrfnl force-pushed the feature/enable-easier-scanning-phpcs branch from 80d436e to b630271 Compare January 17, 2020 19:48
@jrfnl
Copy link
Collaborator Author

jrfnl commented Jan 17, 2020

I've added a second commit implement option 2 for now. Let me know what you think.

@jrfnl jrfnl force-pushed the feature/enable-easier-scanning-phpcs branch from b630271 to e753cbc Compare January 17, 2020 19:51
@sirbrillig
Copy link
Owner

Oh, cool. I didn't know you could do that. I like option 2. Thanks!

@sirbrillig sirbrillig merged commit 51fe610 into sirbrillig:master Jan 17, 2020
@jrfnl jrfnl deleted the feature/enable-easier-scanning-phpcs branch January 17, 2020 21:05
@jrfnl
Copy link
Collaborator Author

jrfnl commented Jan 17, 2020

Oh, cool. I didn't know you could do that. I like option 2. Thanks!

Well, as the DealerDirect plugin registers the standard with PHPCS correctly, it's available, so yes, it can be added to the ruleset ;-)

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

Successfully merging this pull request may close these issues.

2 participants