-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add PHPCS and Stylelint environment, test in CI, ignore from deployment
Verify compliance to coding standards in GH action. The necessary environment files should not be deployed, so the deployment action explicitly uses the .distignore file to exclude them.
- Loading branch information
Showing
11 changed files
with
2,472 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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,13 @@ | ||
/.git | ||
/.github | ||
/node_modules | ||
/vendor | ||
/.distignore | ||
/.editorconfig | ||
/.gitignore | ||
/.stylelintrc.json | ||
/composer.json | ||
/composer.lock | ||
/package.json | ||
/package-lock.json | ||
/phpcs.xml |
This file contains 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,24 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
# WordPress Coding Standards | ||
# https://make.wordpress.org/core/handbook/coding-standards/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[{*.txt,wp-config-sample.php}] | ||
end_of_line = crlf |
This file contains 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 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,24 @@ | ||
name: Tests | ||
on: [push, pull_request] | ||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
tools: composer | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- name: Code style checks for PHP | ||
run: | | ||
composer install | ||
composer lint-php | ||
- name: Code style checks for SCSS | ||
run: | | ||
npm ci | ||
npm run lint-scss |
This file contains 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,4 @@ | ||
/.idea | ||
/*.css | ||
/node_modules | ||
/vendor |
This file contains 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,7 @@ | ||
{ | ||
"extends": "@wordpress/stylelint-config/scss", | ||
"rules": { | ||
"no-descending-specificity": null, | ||
"value-keyword-case": null | ||
} | ||
} |
This file contains 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,44 @@ | ||
{ | ||
"name": "pluginkollektiv/lovelace", | ||
"type": "wordpress-theme", | ||
"license": "GPL-2.0+", | ||
"description": "Atomic Blocks child theme for pluginkollektiv.org", | ||
"homepage": "https://pluginkollektiv.org/", | ||
"authors": [ | ||
{ | ||
"name": "pluginkollektiv", | ||
"homepage": "https://github.com/pluginkollektiv" | ||
} | ||
], | ||
"keywords": [ | ||
"wordpress", "wordpress-theme" | ||
], | ||
"support": { | ||
"issues": "https://github.com/pluginkollektiv/lovelace", | ||
"forum": "https://wordpress.org/support/plugin/lovelace" | ||
}, | ||
"require": { | ||
"php": ">=5.6.0", | ||
"composer/installers": "^v2.3.0" | ||
}, | ||
"require-dev": { | ||
"dealerdirect/phpcodesniffer-composer-installer": "^v1.0.0", | ||
"squizlabs/php_codesniffer": "^3.11.0", | ||
"phpcompatibility/phpcompatibility-wp": "^2.1.5", | ||
"wp-coding-standards/wpcs": "^3.1.0" | ||
}, | ||
"scripts": { | ||
"lint-css": [ | ||
"npx stylelint assets/scss" | ||
], | ||
"lint-php": [ | ||
"phpcs --standard=phpcs.xml -s" | ||
] | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/installers": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
Oops, something went wrong.