Skip to content

Commit

Permalink
feat: Upgrade python_template
Browse files Browse the repository at this point in the history
  • Loading branch information
pagbrl committed Feb 20, 2024
1 parent 5923915 commit 88afefd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 81 deletions.
15 changes: 5 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.254'
rev: "v0.2.1"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
args: [--fix]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-merge-conflict
- id: mixed-line-ending
#- repo: https://github.com/pycqa/bandit
# rev: 1.7.4
# hooks:
Expand All @@ -23,4 +18,4 @@ repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.1
hooks:
- id: python-safety-dependencies-check
- id: python-safety-dependencies-check
107 changes: 36 additions & 71 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,101 +20,66 @@ python = "^3.10"
[tool.poetry.group.dev.dependencies]
pre-commit = "^2.20.0"
pytest = "^7.2.0"
# ruff = "^0.0.254"
tox = "^4.4.8"

[tool.ruff]
select = [
"A",
"ANN",
"ARG",
"B",
"C",
"COM",
"C90",
"E",
"ERA",
"F",
"I",
"N",
"PGH",
"PL",
"PLE",
"PLR",
"PLW",
"PT",
"PTH",
"Q",
"RET",
"RUF",
"SLF",
"SIM",
"TID",
"TRY",
"UP",
"W",
"YTT",
]
ignore = ["A003", "ANN101", "ANN401", "N805", "N818", "PLR0913", "RET504", "RET505"]
# Same as Black.
line-length = 96
target-version = "py310"

fixable = [
"A",
"ANN",
"ARG",
"B",
"C",
"COM",
"C90",
"E",
"ERA",
"F",
"I",
"PGH",
"PL",
"PLE",
"PLR",
"PLW",
"PT",
"PTH",
"Q",
"RET",
"RUF",
"SLF",
"SIM",
"TID",
"TRY",
"UP",
"W",
"YTT",
]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "B"]
ignore = ["E501"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []

dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"pages",
"tests"
]

line-length = 96

dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

target-version = "py310"

[tool.ruff.mccabe]
max-complexity = 10

0 comments on commit 88afefd

Please sign in to comment.