-
Notifications
You must be signed in to change notification settings - Fork 921
Introduce PHP coding-standards thresholds #15911
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6539df0
Introduce thresholds check for CS
moorscode 299411e
Use threshold configuration in Travis
moorscode ecf32a6
Update docs for errors and warnings
moorscode eb58abd
Add exi codes to commands
moorscode c7809e9
Reduce warnings and errors
moorscode 8b2d18a
Add source of inspiration
moorscode 5798dfb
Apply suggestions from code review
moorscode ba180b2
Remove phpcompatibility from the composer requirements
moorscode c42d049
Remove code-coverage ignores from methods
moorscode d63d094
Add action to update thresholds when the results are lower
moorscode 5957a26
Use the last (only) entry from the summary
moorscode 8763171
Use capitalized name of the filter
moorscode aa064fe
Flatten CS check logic
moorscode cf7d2bd
Flatten the CS checks
moorscode 2eda6b8
Use correct bash elseif syntax
moorscode d4edb70
Perform threshold and CS checks on any run
moorscode 307e2d0
Revert running check-cs as this would always fail if we need thresholds
moorscode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,7 @@ | |
}, | ||
"require-dev": { | ||
"yoast/php-development-environment": "^1.0", | ||
"yoast/yoastcs": "~0.4.3", | ||
"phpcompatibility/phpcompatibility-wp": "^2.0.0", | ||
"yoast/yoastcs": "^2.0.0", | ||
"humbug/php-scoper": "^0.12.0", | ||
"brain/monkey": "^2.4", | ||
"phpunit/phpunit": "^5.7", | ||
|
@@ -79,13 +78,17 @@ | |
"lint-staged": [ | ||
"Yoast\\WP\\SEO\\Composer\\Actions::lint_staged" | ||
], | ||
"config-yoastcs": [ | ||
"@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set installed_paths ../../../vendor/wp-coding-standards/wpcs,../../../vendor/yoast/yoastcs,../../../vendor/phpcompatibility/php-compatibility,../../../vendor/phpcompatibility/phpcompatibility-paragonie,../../../vendor/phpcompatibility/phpcompatibility-wp", | ||
"@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set default_standard Yoast" | ||
], | ||
"cs": [ | ||
"Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards" | ||
], | ||
"check-cs-thresholds": [ | ||
"@putenv YOASTCS_THRESHOLD_ERRORS=625", | ||
"@putenv YOASTCS_THRESHOLD_WARNINGS=546", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will these numbers be maintained ? |
||
"Yoast\\WP\\SEO\\Composer\\Actions::check_cs_thresholds" | ||
], | ||
"check-cs-summary": [ | ||
"@check-cs-warnings --report=summary" | ||
], | ||
"check-cs": [ | ||
"@check-cs-warnings -n" | ||
], | ||
|
@@ -94,16 +97,16 @@ | |
"composer check-cs" | ||
], | ||
"check-cs-warnings": [ | ||
"@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs" | ||
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" | ||
], | ||
"check-staged-cs": [ | ||
"Yoast\\WP\\SEO\\Composer\\Actions::check_staged_cs" | ||
"@check-cs-warnings --filter=GitStaged" | ||
], | ||
"check-branch-cs": [ | ||
"Yoast\\WP\\SEO\\Composer\\Actions::check_branch_cs" | ||
], | ||
"fix-cs": [ | ||
"@php ./vendor/squizlabs/php_codesniffer/scripts/phpcbf" | ||
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" | ||
], | ||
"prefix-dependencies": [ | ||
"composer prefix-oauth2-client", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.