Skip to content
Snippets Groups Projects
Unverified Commit 56c8d405 authored by Crystal Lee's avatar Crystal Lee Committed by GitHub
Browse files

Add ruff (#881)

parent a9f89894
No related branches found
No related tags found
No related merge requests found
[flake8]
exclude =
.venv
__pycache__
notebooks
.ipynb_checkpoints
examples
# Recommend matching the black line length (default 88),
# rather than using the flake8 default of 79:
max-line-length = 88
extend-ignore =
# See https://github.com/PyCQA/pycodestyle/issues/373
E203,
...@@ -55,6 +55,7 @@ coverage.xml ...@@ -55,6 +55,7 @@ coverage.xml
*.py,cover *.py,cover
.hypothesis/ .hypothesis/
.pytest_cache/ .pytest_cache/
.ruff_cache
# Translations # Translations
*.mo *.mo
......
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.243
hooks:
- id: ruff
...@@ -53,7 +53,13 @@ You can format and lint your changes with the following commands in the root dir ...@@ -53,7 +53,13 @@ You can format and lint your changes with the following commands in the root dir
make format; make lint make format; make lint
``` ```
We run an assortment of linters: `black`, `isort`, `mypy`, `flake8`. You can also make use of our pre-commit hooks by setting up git hook scripts:
```bash
pre-commit install
```
We run an assortment of linters: `black`, `ruff`, `mypy`.
### Testing ### Testing
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
format: format:
black . black .
isort .
lint: lint:
mypy . mypy .
black . --check black . --check
isort . --check ruff check .
flake8 .
test: test:
pytest tests pytest tests
\ No newline at end of file
[tool.isort]
profile = "black"
[tool.mypy] [tool.mypy]
ignore_missing_imports = "True" ignore_missing_imports = "True"
disallow_untyped_defs = "True" disallow_untyped_defs = "True"
exclude = ["notebooks", "build", "examples"] exclude = ["notebooks", "build", "examples"]
[tool.ruff]
exclude = [
".venv",
"__pycache__",
".ipynb_checkpoints",
".mypy_cache",
".ruff_cache",
"examples",
"notebooks",
]
...@@ -14,8 +14,7 @@ types-setuptools==67.1.0.0 ...@@ -14,8 +14,7 @@ types-setuptools==67.1.0.0
# linting # linting
black==22.12.0 black==22.12.0
isort==5.11.4
mypy==0.991 mypy==0.991
flake8==6.0.0 pre-commit==3.2.0
flake8-docstrings==1.6.0
pylint==2.15.10 pylint==2.15.10
ruff==0.0.259
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment