Skip to content

Commit

Permalink
[ENH] Replace black with ruff; remove isort; add lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
peytondmurray committed Oct 30, 2024
1 parent 7188e14 commit 38d8597
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 16 deletions.
15 changes: 1 addition & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ ci:
[pre-commit.ci] Apply automatic pre-commit fixes
repos:
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
exclude: "examples|tests/assets"

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.6.3"
hooks:
- id: ruff
exclude: "examples|tests/assets"
args: ["--fix"]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -41,11 +36,3 @@ repos:
hooks:
- id: prettier
exclude: ^(examples/|templates/|)

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
name: isort
args: ["--profile", "black"]
exclude: "conda-store-server/conda_store_server/action/__init__.py"
100 changes: 98 additions & 2 deletions conda-store-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,108 @@ lines_after_imports = 2

[tool.ruff]
line-length = 88
exclude = [
"conda_store_server/_internal/alembic/versions/"
]

[tool.ruff.lint]
ignore = [
"E501", # line-length

"E501", # line-length

"ANN001", # missing-type-function-argument
"ANN002", # missing-type-args
"ANN003", # missing-type-kwargs
"ANN101", # missing-type-self
"ANN102", # missing-type-cls
"ANN201", # missing-return-type-undocumented-public-function
"ANN202", # missing-return-type-private-function
"ANN204", # missing-return-type-special-method
"ANN205", # missing-return-type-static-method
"ANN206", # missing-return-type-class-method
"ARG001", # unused-function-argument
"ARG002", # unused-method-argument
"B006", # mutable-argument-default
"B007", # unused-loop-control-variable
"B008", # function-call-in-default-argument
"B011", # assert-false
"B015", # useless-comparison
"B017", # assert-raises-exception
"B018", # useless-expression
"B028", # no-explicit-stacklevel
"B904", # raise-without-from-inside-except
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D200", # fits-on-one-line
"D205", # blank-line-after-summary
"D400", # ends-in-period
"D401", # non-imperative-mood
"D404", # docstring-starts-with-this
"ERA001", # commented-out-code
"FIX001", # line-contains-fixme
"FIX002", # line-contains-todo
"N805", # invalid-first-argument-name-for-method
"N815", # mixed-case-variable-in-class-scope
"PT004", # pytest-missing-fixture-name-underscore
"PT006", # pytest-parametrize-names-wrong-type
"PT011", # pytest-raises-too-broad
"PT012", # pytest-raises-with-multiple-statements
"PT014", # pytest-duplicate-parametrize-test-cases
"PT015", # pytest-assert-always-false
"RET503", # implicit-return
"RET504", # unnecessary-assign
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"SIM105", # suppressible-exception
"SIM115", # open-file-with-context-handler
"SIM117", # multiple-with-statements
"UP006", # non-pep585-annotation
"UP007", # non-pep604-annotation
"UP030", # format-literals
"UP031", # printf-string-formatting
]
select = [
# pycodestyle
"E",
"W",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# pep8 naming
"N",
# pydocstyle
"D",
# annotations
"ANN",
# debugger
"T10",
# flake8-pytest
"PT",
# flake8-return
"RET",
# flake8-unused-arguments
"ARG",
# flake8-fixme
"FIX",
# flake8-eradicate
"ERA",
# pandas-vet
"PD",
# numpy-specific rules
"NPY",
]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.check-wheel-contents]
# ignore alembic migrations https://github.com/jwodder/check-wheel-contents?tab=readme-ov-file#w004--module-is-not-located-at-importable-path
Expand Down

0 comments on commit 38d8597

Please sign in to comment.