Add automatic linter (#4214)

This commit is contained in:
acbin
2023-06-09 20:05:14 +08:00
committed by GitHub
parent 00282efd8b
commit 415a04ea7f
188 changed files with 661 additions and 1133 deletions

16
.github/workflows/clang-format-lint.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: Clang format linter
on:
push: {}
pull_request: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DoozyX/clang-format-lint-action@v0.13
with:
source: './src'
extensions: 'java'
clangFormatVersion: 12

View File

@@ -1,30 +0,0 @@
name: Prettify
on:
push:
paths:
- 'src/**'
- '**.yml'
- '**.xml'
- '**.Dockerfile'
pull_request:
paths:
- 'src/**'
- '**.yml'
- '**.xml'
- '**.Dockerfile'
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Prettify code
uses: creyD/prettier_action@v3.3
with:
prettier_options: --write **/*.java
commit_message: 'Prettify code'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}