-
Notifications
You must be signed in to change notification settings - Fork 16
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 d00c82b
Showing
1 changed file
with
37 additions
and
6 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 |
---|---|---|
@@ -1,17 +1,31 @@ | ||
name: Lint Check (pre-commit) | ||
|
||
on: | ||
pull_request: | ||
push: | ||
on: [pull_request] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
name: pre-commit | ||
permissions: | ||
contents: read | ||
# checks: write | ||
# issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.13 | ||
|
||
- name: Cache pre-commit hooks | ||
uses: actions/cache@v2 | ||
with: | ||
python-version: '3.13' | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Get Changed Files | ||
id: changed-files | ||
|
@@ -22,3 +36,20 @@ jobs: | |
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }} | ||
continue-on-error: true | ||
|
||
# - 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 |