-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from a8cteam51/featrure/use-new-phpcs-setup
Featrure/use new phpcs setup
- Loading branch information
Showing
12 changed files
with
760 additions
and
112 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,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,yaml,json}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.txt] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Bug report | ||
description: Create a bug report to help us improve. | ||
body: | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: steps | ||
attributes: | ||
label: Steps to reproduce | ||
placeholder: | | ||
1. Start at `site-domain.com/blog`. | ||
2. Click on any blog post. | ||
3. Click on the 'Like' button. | ||
4. ... | ||
Attach any media by drag and dropping or selecting upload. | ||
- type: textarea | ||
id: expected | ||
attributes: | ||
label: What you expected to happen | ||
placeholder: | | ||
e.g. The post should be liked. | ||
- type: textarea | ||
id: actual | ||
attributes: | ||
label: What actually happened | ||
placeholder: | | ||
e.g. Clicking the button does nothing visibly. |
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 @@ | ||
blank_issues_enabled: true |
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,18 @@ | ||
name: Feature request | ||
description: Create a feature request for this project. | ||
body: | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: Add a concise description of the feature being requested. | ||
placeholder: What will this feature accomplish? | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: context | ||
attributes: | ||
label: Additional context | ||
description: Add any other context or screenshots about the feature request here. | ||
placeholder: Add links to previous work or other sites that do something similar. |
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,14 @@ | ||
#### Changes proposed in this Pull Request | ||
|
||
* | ||
|
||
#### Testing instructions | ||
|
||
<!-- | ||
Add as many details as possible to help others reproduce the issue and test the fix. | ||
"Before / After" screenshots can also be very helpful when the change is visual. | ||
--> | ||
|
||
* | ||
|
||
Mentions # |
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,42 @@ | ||
name: PHP Coding Standards | ||
|
||
on: | ||
pull_request: | ||
branches: [ trunk, develop ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
php: [ 8.2 ] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup proper PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer run-script packages-install | ||
|
||
- name: Run PHP_CodeSniffer | ||
run: composer run-script lint:php |
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,31 @@ | ||
name: PHP Syntax Errors | ||
|
||
on: | ||
push: | ||
branches: [ trunk, develop ] | ||
pull_request: | ||
branches: [ trunk, develop ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
php: [ 7.4, 8.0, 8.1, 8.2, 8.3 ] # Include all PHP versions between the absolute minimum that shouldn't throw an error and the latest release version. | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup proper PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
|
||
- name: Check all files for syntax errors | ||
if: ${{ matrix.php >= 8.0 }} # At least the minimum PHP version required by the plugin. | ||
run: find -L $GITHUB_WORKSPACE -path $GITHUB_WORKSPACE/vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l | ||
|
||
- name: Check bootstrap files for syntax errors | ||
if: ${{ matrix.php <= 7.4 }} | ||
run: find $GITHUB_WORKSPACE -maxdepth 1 -name 'colophon.php' -print0 | xargs -0 -n 1 -P 4 php -l |
Oops, something went wrong.