-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include prettier-php and adjust phplint workflows.
update pr template. include stylelint install and call
- Loading branch information
1 parent
9f13dc7
commit fe39d9a
Showing
15 changed files
with
3,020 additions
and
202 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
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
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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
name: PHP Linting | ||
on: | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
|
||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
jobs: | ||
phplint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: overtrue/[email protected] | ||
with: | ||
path: . | ||
options: --exclude="system/libs/polyfill-mbstring/bootstrap80.php" | ||
phplint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: overtrue/[email protected] | ||
with: | ||
path: . | ||
options: --exclude="system/libs/polyfill-mbstring/bootstrap80.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,59 @@ | ||
--- | ||
name: Format Prettier | ||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
merge_group: | ||
push: | ||
paths: | ||
- '*/**' | ||
jobs: | ||
cancel-runs: | ||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
run: | | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "GitHub Actions" | ||
- name: Actions checkout | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Dependencies | ||
run: npm install prettier @prettier/plugin-php stylelint-prettier | ||
|
||
- name: Run prettier code format | ||
run: npx prettier --write **/*.{php,js} --plugin=@prettier/plugin-php --ignore-unknown && npx stylelint **/*.css --fix | ||
|
||
# - name: Run stylelint css format | ||
# run: npx stylelint **/*.css --fix | ||
|
||
- name: Run add and commit | ||
if: ${{ github.ref != 'refs/heads/main' }} | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: GitHub Actions | ||
author_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
message: 'PHP code format - (prettier)' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,19 @@ | ||
# Ignore system libs | ||
|
||
plugins/ | ||
system/libs/PagSeguroLibrary | ||
system/libs/phpmailer | ||
system/libs/polyfill-mbstring | ||
system/libs/pot | ||
system/libs/semver | ||
system/libs/Twig | ||
system/cache | ||
system/php_sessions | ||
node_modules | ||
|
||
# Files | ||
login.php | ||
|
||
# Styles | ||
admin/bootstrap/pace/templates/pace-theme-loading-bar.tmpl.css | ||
admin/bootstrap/pace/templates/pace-theme-mac-osx.tmpl.css |
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,17 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.php" | ||
], | ||
"options": { | ||
"parser": "php", | ||
"singleQuote": true, | ||
"semi": false, | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"trailingComma": "none" | ||
} | ||
} | ||
] | ||
} |
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,8 @@ | ||
{ | ||
"plugins": ["stylelint-prettier"], | ||
"ignoreFiles": ["**/*.min.css"], | ||
"rules": { | ||
"prettier/prettier": true | ||
}, | ||
"extends": ["stylelint-prettier/recommended"] | ||
} |
Oops, something went wrong.