Skip to content

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Feb 23, 2020

This is the same PR as previously pulled in PR JakubOnderka/PHP-Parallel-Lint#146

Composer: update the PHPCS dependency

The current version is 3.5.4 released end of January 2020 and - aside from lots of bug fixes -, it includes compatibility with PHP 7.4.

See: https://github.com/squizlabs/php_codesniffer/releases

Travis: only run PHPCS once

The results of PHPCS run will be no different across PHP versions as all sniffs are unit tested against all supported PHP versions, so it is unnecessary to run it against every PHP version, just run it once per build.

I've chosen to run it against PHP 7.4 as that's the fastest PHP version.

PHPCS: tweak ruleset

  • Rename the ruleset to one which PHPCS will recognize automatically.
    This means you no longer need to pass the --standard on the command-line.
  • Use the dist extension to allow for devs to overload the ruleset file locally and gitignore the typical overload file names which are recognized by PHPCS by default.
  • Ruleset/Travis: move command-line arguments to the project ruleset.
    ... and scan all PHP files, not just the files in src.
  • Ruleset: also scan the phpt test files.
  • Ruleset: enable parallel scanning.
  • Ruleset: set the basepath for a cleaner output report.
  • Ruleset: add the PHPCS XML scheme.
  • Ruleset: selectively exclude the skip-linting.php file for the Generic.PHP.NoSilencedErrors rule.

CS: minor clean up

jrfnl added 4 commits March 25, 2020 13:01
The current version is `3.5.4` released end of January 2020 and - aside from lots of bug fixes -, it includes compatibility with PHP 7.4.

See: https://github.com/squizlabs/php_codesniffer/releases
The results of PHPCS run will be no different across PHP versions as all sniffs are unit tested against all supported PHP versions, so it is unnecessary to run it against every PHP version, just run it once per build.

I've chosen to run it against PHP 7.4 as that's the fastest PHP version.
* Rename the ruleset to one which PHPCS will recognize automatically.
    This means you no longer need to pass the `--standard` on the command-line.
* Use the `dist` extension to allow for devs to overload the ruleset file locally and gitignore the typical overload file names which are recognized by PHPCS by default.
* Ruleset/Travis: move command-line arguments to the project ruleset.
    ... and scan all PHP files, not just the files in `src`.
* Ruleset: also scan the `phpt` test files.
* Ruleset: enable parallel scanning.
* Ruleset: set the basepath for a cleaner output report.
* Ruleset: add the PHPCS XML scheme.
* Ruleset: selectively exclude the `skip-linting.php` file for the `Generic.PHP.NoSilencedErrors` rule.
@jrfnl jrfnl force-pushed the feature/various-phpcs-tweaks-pl branch from 92a485b to c1d07cf Compare March 25, 2020 12:03
@jrfnl
Copy link
Collaborator Author

jrfnl commented Mar 25, 2020

Rebased to fix conflict status.

@grogy grogy merged commit 9c39813 into php-parallel-lint:master Apr 9, 2020
@grogy
Copy link
Member

grogy commented Apr 9, 2020

It look's good, thank you :-)

@jrfnl jrfnl deleted the feature/various-phpcs-tweaks-pl branch April 9, 2020 16:47
@jrfnl
Copy link
Collaborator Author

jrfnl commented Apr 9, 2020

You're welcome ;-)

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

Development

Successfully merging this pull request may close these issues.

2 participants