ci: add prettier formatting (#130)

This commit is contained in:
winston 2023-07-25 02:44:35 +02:00 committed by GitHub
parent d7f460f308
commit 79d77568ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

22
.github/workflows/format.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Prettier
on:
pull_request:
push:
branches: [main]
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Run prettier
uses: creyD/prettier_action@v4.3
with:
commit_message: "style: format code with prettier"
prettier_options: "--write styles/**/*.css"

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
/styles/codeberg/
/styles/reddit/

10
.prettierrc Normal file
View File

@ -0,0 +1,10 @@
{
"overrides": [
{
"files": "styles/**/*.css",
"options": {
"parser": "less"
}
}
]
}