-
Notifications
You must be signed in to change notification settings - Fork 109
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
CI - Add code sniffer #744
CI - Add code sniffer #744
Conversation
.github/workflows/ci.yml
Outdated
# concurrency: | ||
# group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
# cancel-in-progress: true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove L11-15 completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
.github/workflows/ci.yml
Outdated
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Initialize Cache Composer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
.github/workflows/ci.yml
Outdated
path: .cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | ||
|
||
# Initialize Node.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this comment the step's name instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to name
.github/workflows/ci.yml
Outdated
|
||
- run: npm ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, change ci
to clean-install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I do something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- run: npm clean-install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
.prettierrc
Outdated
@@ -2,14 +2,20 @@ | |||
"overrides": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all .prettierrc
changes from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted to previous version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file shouldn't show up at all in https://github.com/litespeedtech/lscache_wp/pull/744/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
composer.json
Outdated
"scripts": { | ||
"post-install-cmd": "phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility", | ||
"post-update-cmd": "phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility", | ||
"sniff-check": "phpcs --standard=./phpcs.xml.dist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS should find the "standard" config without specifying it here. Please, test and confirm this works.
"sniff-check": "phpcs"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works and changed
@szepeviktor these changes have been applied to the future version of the plugin. Thank you! |
Please consider choosing a coding standard: PSR, WordPress, custom or a minimal one. I could add EditorConfig (for Prettier) and syntax error check. As for static analysis: the plugin should pass PHPStan level 0. |
No description provided.