Skip to content

Commit

Permalink
Replace flake8, isort etc. with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 20, 2023
1 parent 8a19957 commit 81620ac
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 39 deletions.
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/pycqa/flake8
rev: '6.0.0'
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.247'
hooks:
- id: flake8
- id: ruff
args: [--fix]

- repo: local
hooks:
Expand All @@ -50,9 +51,3 @@ repos:
- id: mypy
name: "MyPy"
additional_dependencies: ["types-all", "pydantic~=1.10"]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: "isort"
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[tool.ruff]
select = ["E", "F", "I", "W", "Q"]
ignore = ["E501", "E402"]
fixable = ["A", "B", "C", "D", "E", "F", "I"]
unfixable = []
extend-exclude = [
"providers",
]
target-version = "py310"
per-file-ignores = {}
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.mypy]
plugins = "pydantic.mypy"
ignore_missing_imports = true
follow_imports = "skip"

[tool.pytest.ini_options]
filterwarnings = [
"error",
"ignore:.*parameter is deprecated for the.*:DeprecationWarning",
"ignore:.*read_text is deprecated.*:DeprecationWarning",
"ignore:.*open_text is deprecated.*:DeprecationWarning",
"ignore:.*SixMetaPathImporter.*:ImportWarning",
"ignore:.*PY_SSIZE_T_CLEAN will be required for.*:DeprecationWarning",
"ignore:.*not found, cannot convert structure.*:",
"ignore:.*will default to setting mass to 1.0.:",
"ignore:.*is missing fields.*which are required if.*:",
"ignore:.*the imp module is deprecated in favour of importlib.*:DeprecationWarning",
"ignore:.*has an unrecognised prefix.*:",
]
testpaths = "tests"
addopts = "-rs"

[tool.isort]
known_first_party = "optimade"
profile = "black"
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ pre-commit==3.0.4
pylint==2.16.2
pytest==7.2.1
pytest-cov==4.0.0
ruff==0.0.247
types-all==1.0.0
30 changes: 0 additions & 30 deletions setup.cfg

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"pre-commit~=3.0",
"invoke~=2.0",
"types-all==1.0.0",
"ruff==0.0.247",
]
+ docs_deps
+ testing_deps
Expand Down

0 comments on commit 81620ac

Please sign in to comment.