We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Idea: For PRs, detect coding standard violations via PHP_CodeSniffer. Errors should prevent the PR from being merged and shown to the user.
Implementation:
phpcs
Result:
name: PHP_CodeSniffer on: pull_request jobs: phpcs: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '7.3' coverage: none tools: composer, cs2pr - name: Get Composer cache directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Setup cache uses: pat-s/always-upload-cache@v1.1.4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-composer- - name: Install dependencies run: composer install --prefer-dist --no-suggest --no-progress - name: Detect coding standard violations run: vendor/bin/phpcs -nq --report=checkstyle | cs2pr
Limits:
The text was updated successfully, but these errors were encountered:
Related blog post: https://dominikschilling.de/schnipsel/github-action-workflow-php-codesniffer-check-annotations/
Sorry, something went wrong.
I really like the GitHub Action though I think it is not necessary to give feedback on files that have not been changed like so:
By only checking the modified files it could slightly help with the annotation limit.
We could use the File Changes Action to only check the modified files.
Moved to https://handbook.required.com/development/coding-standards/continuous-integration-ci/#github-workflow.
No branches or pull requests
Idea:
For PRs, detect coding standard violations via PHP_CodeSniffer. Errors should prevent the PR from being merged and shown to the user.
Implementation:
phpcs
phpcs
as a required status check.Result:
Limits:
The text was updated successfully, but these errors were encountered: