-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nicola Sella <[email protected]>
- Loading branch information
Showing
3 changed files
with
84 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,18 @@ | ||
name: pre-commit | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
env: | ||
SKIP: no-commit-to-branch | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: | | ||
3.9 | ||
3.x | ||
- 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,16 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.6.0 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [ --fix ] | ||
# Run the formatter. | ||
- id: ruff-format |
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,50 @@ | ||
|
||
line-length = 100 | ||
[format] | ||
exclude = [ | ||
".git", | ||
".venv", | ||
".history", | ||
"build", | ||
"dist", | ||
"docs", | ||
"hack", | ||
] | ||
quote-style = "preserve" | ||
[lint] | ||
select = [ | ||
# More stuff here https://docs.astral.sh/ruff/rules/ | ||
"F", # Pyflakes | ||
"E", # Pycodestyle Error | ||
"W", # Pycodestyle Warning | ||
"N", # PEP8 Naming | ||
# TODO "UP", # Pyupgrade | ||
# TODO "ANN", | ||
# TODO "S", # Bandit | ||
# "B", # Bugbear | ||
"A", # flake-8-builtins | ||
"YTT", # flake-8-2020 | ||
"PLC", # Pylint Convention | ||
"PLE", # Pylint Error | ||
"PLW", # Pylint Warning | ||
] | ||
# Some checks should be enabled for code sanity disabled now | ||
# to avoid changing too many lines | ||
ignore = [ | ||
"F821", # TODO Undefined name | ||
"F541", # TODO f-string is missing placeholders | ||
"F401", # TODO Module imported but unused | ||
"F841", # TODO Local variable is assigned to but never used | ||
"E402", # TODO Module level import not at top of file | ||
"E741", # TODO ambiguous variable name | ||
"E722", # TODO do not use bare 'except' | ||
"E501", # TODO line too long | ||
"N818", # TODO Error Suffix in exception name | ||
"N80", # TODO Invalid Name | ||
"ANN10", # Missing type annotation | ||
"PLW2901", # TODO Redefined Loop Name | ||
] | ||
[lint.per-file-ignores] | ||
"podman/tests/*.py" = ["S"] | ||
[lint.flake8-builtins] | ||
builtins-ignorelist = ["copyright", "all"] |