forked from gravitywiz/snippet-library
-
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.
~ Added PHPCS and GitHub Action to accommodate it
- Loading branch information
1 parent
f403635
commit 5395619
Showing
5 changed files
with
354 additions
and
0 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,16 @@ | ||
name: PHP Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
PHPCS: | ||
name: PHPCS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: composer install --dev --prefer-dist --no-progress --no-suggest | ||
- name: PHPCS check | ||
uses: chekalsky/phpcs-action@v1 | ||
with: | ||
phpcs_bin_path: './vendor/bin/phpcs' |
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,30 @@ | ||
# macOS Junk Files | ||
.DS_Store | ||
|
||
# Composer | ||
/vendor | ||
|
||
# NPM/Yarn | ||
/node_modules | ||
|
||
# IDE | ||
.idea | ||
|
||
# Transpiled/Built/Minified Files | ||
*.js.map | ||
*.min.js | ||
*.css.map | ||
*.min.css | ||
/dist | ||
/js/built | ||
|
||
# Cypress | ||
cypress/screenshots | ||
cypress/videos | ||
|
||
# Private Files (Personal or sensitive info to not version control) | ||
.env | ||
.envrc | ||
*.log | ||
_output | ||
results.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,11 @@ | ||
{ | ||
"require-dev": { | ||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", | ||
"wp-coding-standards/wpcs": "^2.3", | ||
"phpcompatibility/php-compatibility": "*" | ||
}, | ||
"scripts": { | ||
"lint": "phpcs", | ||
"lint:fix": "phpcbf" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,34 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Gravity Wiz Coding Standards"> | ||
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml --> | ||
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards --> | ||
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml --> | ||
|
||
<arg name="extensions" value="php,css"/> | ||
|
||
<file>.</file> | ||
|
||
<!-- Exclude Composer vendor directory. --> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
|
||
<!-- Exclude NPM modules --> | ||
<exclude-pattern>*/node_modules/*</exclude-pattern> | ||
|
||
<!-- Handled by ESLint --> | ||
<exclude-pattern>*.js</exclude-pattern> | ||
|
||
<!-- Run against the PHPCompatibility ruleset --> | ||
<rule ref="PHPCompatibility"/> | ||
<config name="testVersion" value="5.6-"/> | ||
|
||
<!-- Turns on the WordPress Standard --> | ||
<rule ref="WordPress-Core"> | ||
<exclude name="WordPress.PHP.YodaConditions.NotYoda" /> | ||
<exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase" /> | ||
<exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase" /> | ||
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" /> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" /> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" /> | ||
</rule> | ||
</ruleset> |