-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add automatic linting suggestion github workflow
- Loading branch information
1 parent
bd7ad35
commit be79e3d
Showing
1 changed file
with
41 additions
and
0 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,41 @@ | ||
name: linter-checks | ||
on: [pull_request] | ||
jobs: | ||
cpp: | ||
permissions: | ||
contents: read | ||
checks: write | ||
issues: write | ||
pull-requests: write | ||
name: pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Cache pre-commit hooks | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pre-commit | ||
- name: Run pre-commit hooks | ||
run: | | ||
pre-commit run --all-files | ||
continue-on-error: true | ||
|
||
- name: suggester / pre-commit | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: pre-commit | ||
fail_on_error: true | ||
level: warning |