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

Use PHP-Code-Style 2.0 #29

Merged
merged 4 commits into from
Dec 20, 2021
Merged

Use PHP-Code-Style 2.0 #29

merged 4 commits into from
Dec 20, 2021

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Dec 19, 2021

PHPCS: use PHP-Code-Style 2.0

  • Composer: require php-parallel-lint/php-code-style at 2.0 or higher.
  • Composer: remove the requirement for PHPCS. This will now be inherited from the code style repo.

Ruleset: various tweaks for PHP-Code-Style 2.0

  • Scan all PHP files, not just the file in src for improved consistency across the code base, but exclude the vendor and the build (code coverage) directories.
  • Enable parallel scanning for faster results.
  • Use the ruleset from PHP-Code-Style by name.
  • Set the testVersion for use with PHPCompatibility.
  • Exclude the LineLength sniff for the tests.
  • Include minimal documentation in the ruleset.

CS: various minor fixes

Fix up the issues which will be flagged by PHP-Code-Style 2.0 and explicitly ignore a couple of (non-)issues.

Includes no longer allowing warnings in the GH Actions build.

Highlighter::getTokenType(): refactor to lower complexity

Rewrite the method to use predefined token lists.

Includes removing the PHPCS ruleset tweak put in place in an earlier commit.

Fixes #11

* Composer: require `php-parallel-lint/php-code-style` at 2.0 or higher.
* Composer: remove the requirement for PHPCS. This will now be inherited from the code style repo.
* Scan all PHP files, not just the file in `src` for improved consistency across the code base, but exclude the `vendor` and the `build` (code coverage) directories.
* Enable parallel scanning for faster results.
* Use the ruleset from PHP-Code-Style by name.
* Set the `testVersion` for use with PHPCompatibility.
* Exclude the `LineLength` sniff for the tests.
* Include minimal documentation in the ruleset.
Fix up the issues which will be flagged by PHP-Code-Style 2.0 and explicitly ignore a couple of (non-)issues.

Includes no longer allowing warnings in the GH Actions build.
@jrfnl jrfnl added this to the 1.0.0 milestone Dec 19, 2021
@jrfnl jrfnl requested a review from grogy December 19, 2021 06:09
Rewrite the method to use predefined token lists.

Includes removing the PHPCS ruleset tweak put in place in an earlier commit.

Fixes 11
@grogy
Copy link
Member

grogy commented Dec 20, 2021

Thank you

Big plus points for the Includes no longer allowing warnings in the GH Actions build. :-)

@grogy grogy merged commit b6e254a into master Dec 20, 2021
@jrfnl jrfnl deleted the feature/update-code-style branch December 20, 2021 12:58
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.

PHP_CodeSniffer coding style error
2 participants