diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed3ca83..2fc1aee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,8 +17,9 @@ repos: rev: v0.1.9 hooks: - id: ruff - args: [--fix] + args: [--fix, --exit-non-zero-on-fix] - id: ruff-format + args: [--line-length=88] - repo: local hooks: - id: pyright diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..1e915bc --- /dev/null +++ b/ruff.toml @@ -0,0 +1,19 @@ +# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. +select = ["E", "F", "I"] +ignore = [] + +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["A", "B", "C", "D", "E", "F", "I"] +unfixable = [] + +# Same as Black. +line-length = 88 + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +# Assume Python 3.8 +target-version = "py38" + +[isort] +known-first-party = ["nbmake"]