-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIXME: Get Node ID Add Pre-Commit and Ruff in Github Actions
- Loading branch information
Showing
4 changed files
with
92 additions
and
26 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 |
---|---|---|
|
@@ -89,6 +89,16 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
# pre-commit or ruff as example | ||
- uses: pre-commit/[email protected] | ||
- uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: --check --fix ./python/ | ||
src: "./python" | ||
- uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: "format --check" | ||
src: "./python" | ||
- name: Install virtualenv | ||
run: pip install virtualenv | ||
- name: Python tests | ||
|
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,14 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] |
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,40 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
default_language_version: | ||
python: python3.12 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: check-toml | ||
# All non-bat files should end with LF | ||
- id: mixed-line-ending | ||
name: Ensure LF endings on most files | ||
args: [ "--fix=lf" ] | ||
exclude: \.bat$ | ||
# Bat files should end with CRLF | ||
- id: mixed-line-ending | ||
name: Ensure CFLF endings on Windows files | ||
args: [ "--fix=crlf" ] | ||
files: \.bat$ | ||
- id: detect-private-key | ||
- id: no-commit-to-branch | ||
args: [ --branch, main, --branch, master ] | ||
stages: [ commit-msg ] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.9 | ||
hooks: | ||
- id: ruff | ||
args: [--fix --line-length=120] | ||
- id: ruff-format | ||
types_or: [ python, pyi ] | ||
ci: | ||
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks | ||
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate |
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