-
Notifications
You must be signed in to change notification settings - Fork 2
chore: Fix PHP linting errors for previews plugin and setup automated code quality #236
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
20 commits
Select commit
Hold shift + click to select a range
b2f4cfc
Re-enabled PHPCS and added fixes for code style.
colinmurphy adb541b
Forgot to add missing file.
colinmurphy 628706e
Merged main branch.
colinmurphy ef19475
Fixed PHP Psalm errors.
colinmurphy 4d398bc
PHPStan errors.
colinmurphy d78fc07
Adding code quality check for a PR.
colinmurphy 6b93890
Updating composer commands to match webhooks. Added code quality work…
colinmurphy 5c04e9c
Fix working directory for composer install.
colinmurphy ec82092
Refactor of code quality workflow.
colinmurphy cfffa71
Renamed file.
colinmurphy edec4b0
Fixed path for action.
colinmurphy d691982
Fix for Psalm error.
colinmurphy 5ffc6ce
Psalm fix.
colinmurphy 1277c0c
Fix for Psalm.
colinmurphy 365401e
Fix for PHPCS to reduce complexity of defining constants.
colinmurphy 414e305
Added fix for settings page.
colinmurphy 4596cf6
Changed method name.
colinmurphy 7c4bd85
Text domain fixes. Thanks @josephfusco
colinmurphy 0a6ece6
More fixes for the text domain.
colinmurphy d0fda91
Fixed PHP CS errors.
colinmurphy 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: 'PHP Code Quality' | ||
| description: 'Sets up PHP and runs code quality tools' | ||
| inputs: | ||
| working-directory: | ||
| description: 'Directory to run composer and quality tools in' | ||
| required: true | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '7.4' | ||
| tools: composer:v2 | ||
| coverage: none | ||
|
|
||
| - name: Install dependencies | ||
| uses: ramsey/composer-install@v2 | ||
| with: | ||
| working-directory: ${{ inputs.working-directory }} | ||
| composer-options: "--no-progress" | ||
|
|
||
| - name: Run PHPStan | ||
| working-directory: ${{ inputs.working-directory }} | ||
| run: composer run-script phpstan | ||
| shell: bash | ||
|
|
||
| - name: Run Psalm | ||
| working-directory: ${{ inputs.working-directory }} | ||
| run: composer run-script php:psalm | ||
| shell: bash | ||
|
|
||
| - name: Run PHP CodeSniffer | ||
| working-directory: ${{ inputs.working-directory }} | ||
| run: composer run-script check-cs | ||
| shell: bash |
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Code Quality | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'plugins/**' | ||
|
|
||
| jobs: | ||
| run: | ||
| runs-on: ubuntu-latest | ||
| name: Check code quality | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Get changed plugin directory | ||
| id: plugin | ||
| run: | | ||
| git fetch --prune --unshallow | ||
| plugin=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '^plugins/' | head -1 | cut -d/ -f2) | ||
| echo "slug=$plugin" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: PHP Code Quality | ||
| uses: ./.github/actions/code-quality | ||
| with: | ||
| working-directory: plugins/${{ steps.plugin.outputs.slug }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.