Skip to content

Commit f3864c4

Browse files
committed
towards ruff
1 parent 3bff10e commit f3864c4

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-toml
6+
- id: check-yaml
7+
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: 'v0.14.2'
10+
hooks:
11+
- id: ruff
12+
args: [ --fix, --exit-non-zero-on-fix, --unsafe-fixes ]
13+
14+
# Run the formatter
15+
- id: ruff-format
16+
17+
#- repo: https://github.com/igorshubovych/markdownlint-cli
18+
# rev: v0.45.0
19+
# hooks:
20+
# - id: markdownlint
21+
# args: ["--disable", "MD013"]
22+
23+
- repo: https://github.com/python-jsonschema/check-jsonschema
24+
rev: 0.34.1
25+
hooks:
26+
#- id: check-renovate
27+
# args: [ "--verbose" ]
28+
29+
- id: check-github-workflows
30+
args: ["--verbose"]
31+
32+
#- repo: https://github.com/rhysd/actionlint
33+
# rev: v1.7.8
34+
# hooks:
35+
# - id: actionlint
36+
# args: [ -ignore, SC ]
37+
38+
#- repo: https://github.com/abravalheri/validate-pyproject
39+
# rev: v0.24.1
40+
# hooks:
41+
# - id: validate-pyproject

ruff.toml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Maximum line length for the entire project
2+
line-length = 120
3+
# Target Python version
4+
target-version = "py311"
5+
#
6+
## Exclude directories with Jinja template variables in their names
7+
#exclude = ["**/[{][{]*/", "**/*[}][}]*/"]
8+
#
9+
#[lint]
10+
## Available rule sets in Ruff:
11+
## A: flake8-builtins - Check for python builtins being used as variables or parameters
12+
## B: flake8-bugbear - Find likely bugs and design problems
13+
## C4: flake8-comprehensions - Helps write better list/set/dict comprehensions
14+
## D: pydocstyle - Check docstring style
15+
## E: pycodestyle errors - PEP 8 style guide
16+
## ERA: eradicate - Find commented out code
17+
## F: pyflakes - Detect logical errors
18+
## I: isort - Sort imports
19+
## N: pep8-naming - Check PEP 8 naming conventions
20+
## PT: flake8-pytest-style - Check pytest best practices
21+
## RUF: Ruff-specific rules
22+
## S: flake8-bandit - Find security issues
23+
## SIM: flake8-simplify - Simplify code
24+
## T10: flake8-debugger - Check for debugger imports and calls
25+
## UP: pyupgrade - Upgrade syntax for newer Python
26+
## W: pycodestyle warnings - PEP 8 style guide warnings
27+
## ANN: flake8-annotations - Type annotation checks
28+
## ARG: flake8-unused-arguments - Unused arguments
29+
## BLE: flake8-blind-except - Check for blind except statements
30+
## COM: flake8-commas - Trailing comma enforcement
31+
## DTZ: flake8-datetimez - Ensure timezone-aware datetime objects
32+
## EM: flake8-errmsg - Check error message strings
33+
## FBT: flake8-boolean-trap - Boolean argument checks
34+
## ICN: flake8-import-conventions - Import convention enforcement
35+
## ISC: flake8-implicit-str-concat - Implicit string concatenation
36+
## NPY: NumPy-specific rules
37+
## PD: pandas-specific rules
38+
## PGH: pygrep-hooks - Grep-based checks
39+
## PIE: flake8-pie - Miscellaneous rules
40+
## PL: Pylint rules
41+
## Q: flake8-quotes - Quotation style enforcement
42+
## RSE: flake8-raise - Raise statement checks
43+
## RET: flake8-return - Return statement checks
44+
## SLF: flake8-self - Check for self references
45+
## TCH: flake8-type-checking - Type checking imports
46+
## TID: flake8-tidy-imports - Import tidying
47+
## TRY: flake8-try-except-raise - Try/except/raise checks
48+
## YTT: flake8-2020 - Python 2020+ compatibility
49+
#
50+
## Selected rule sets to enforce:
51+
## D: pydocstyle - Check docstring style
52+
## E: pycodestyle errors - PEP 8 style guide
53+
## F: pyflakes - Detect logical errors
54+
## I: isort - Sort imports
55+
## N: pep8-naming - Check PEP 8 naming conventions
56+
## W: pycodestyle warnings - PEP 8 style guide warnings
57+
## UP: pyupgrade - Upgrade syntax for newer Python
58+
#select = ["D", "E", "F", "I", "N", "W", "UP"]
59+
#
60+
## Resolve incompatible pydocstyle rules: prefer D211 and D212 over D203 and D213
61+
#ignore = ["D203", "D213"]
62+
#
63+
#[lint.pydocstyle]
64+
#convention = "google"
65+
#
66+
## Formatting configuration
67+
#[format]
68+
## Use double quotes for strings
69+
#quote-style = "double"
70+
## Use spaces for indentation
71+
#indent-style = "space"
72+
## Automatically detect and use the appropriate line ending
73+
#line-ending = "auto"
74+
#
75+
## File-specific rule exceptions
76+
#[lint.per-file-ignores]
77+
#"tests/**/*.py" = ["S101"] # Allow assert statements in tests
78+
#"book/marimo/*.py" = ["N803", "S101"] # Allow non-lowercase variable names (N803)
79+
# # and assert statements in marimo files

0 commit comments

Comments
 (0)