action: use autofix.ci to format code

opt: ignore clang-format on style/js files

action: prettier ignore file
This commit is contained in:
YiFang Xiao 2023-07-15 08:29:28 +08:00 committed by xiaoyifang
parent 119a5ccb6c
commit bfba6e1f67
8 changed files with 70 additions and 3 deletions

View file

@ -1,4 +1,4 @@
name: "auto clang-format code" name: autofix.ci
on: on:
pull_request: pull_request:
@ -12,7 +12,8 @@ on:
- "howto/**" - "howto/**"
- "*.md" - "*.md"
- "locale/**" - "locale/**"
permissions:
contents: read
jobs: jobs:
format: format:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -42,3 +43,27 @@ jobs:
with: with:
default_author: github_actor default_author: github_actor
message: 🎨 apply clang-format changes message: 🎨 apply clang-format changes
- uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0
css-js-html-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: |
npm ci
- run: npx prettier --write src/stylesheets src/scripts/gd-*.js
# Optimize all PNGs with https://pngquant.org/
# - run: sudo apt-get update && sudo apt-get install -y pngquant
# - name: Run pngquant
# run: |
# shopt -s globstar
# pngquant -f --ext .png --skip-if-larger -- **/*.png
- uses: autofix-ci/action@89762f9c25dd85f6b78cd40e521232e403357ec0

2
.gitignore vendored
View file

@ -56,3 +56,5 @@ GoldenDict_resource.rc
*.TMP *.TMP
*.orig *.orig
node_modules

2
.prettierignore Normal file
View file

@ -0,0 +1,2 @@
**/.clang-format

1
.prettierrc.json Normal file
View file

@ -0,0 +1 @@

24
package-lock.json generated Normal file
View file

@ -0,0 +1,24 @@
{
"name": "goldendict",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"devDependencies": {
"prettier": "3.0.0"
}
},
"node_modules/prettier": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.0.0.tgz",
"integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
}
}
}
}

5
package.json Normal file
View file

@ -0,0 +1,5 @@
{
"devDependencies": {
"prettier": "3.0.0"
}
}

View file

@ -0,0 +1,4 @@
---
DisableFormat: true
SortIncludes: Never
...

View file

@ -0,0 +1,4 @@
---
DisableFormat: true
SortIncludes: Never
...