Skip to content

Commit

Permalink
replace flake8, isort, pycodestyle with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed Jun 27, 2023
1 parent 73f8339 commit 7a3fad3
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,14 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-testing.txt
- name: Lint with pycodestyle
run: |
pip install pycodestyle
pycodestyle src/maggma
- name: Lint with mypy
run: |
pip install mypy mypy-boto3
mypy src/maggma
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 --count --show-source --statistics src/maggma
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics src/maggma
- name: Ruff
uses: chartboost/ruff-action@v1


test:
needs: lint
Expand Down
5 changes: 3 additions & 2 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pytest-cov==3.0.0
pytest-mock==3.10.0
pytest-xdist==2.5.0
moto==3.1.17
pydocstyle==6.1.1
flake8==4.0.1
#pydocstyle==6.1.1
#flake8==4.0.1
ruff==0.0.275
mypy==0.971
mypy-extensions==0.4.3
responses<0.22.0
Expand Down
13 changes: 13 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Never enforce `E471`
ignore = ["E741"]

# Set max line length
line-length = 120

# exclude some files
exclude = [
".git",
"__pycache__",
"docs",
"__init__.py"
]
24 changes: 12 additions & 12 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[tool:pytest]
addopts = --durations=30

[pycodestyle]
count = True
ignore = E121,E123,E126,E133,E226,E241,E242,E704,W503,W504,W505,E741,W605,W293
max-line-length = 120
statistics = True
# [pycodestyle]
# count = True
# ignore = E121,E123,E126,E133,E226,E241,E242,E704,W503,W504,W505,E741,W605,W293
# max-line-length = 120
# statistics = True

[flake8]
exclude = .git,__pycache__,docs_rst/conf.py,tests,pymatgen/io/abinit,__init__.py
# max-complexity = 10
extend-ignore = E741
max-line-length = 120
# [flake8]
# exclude = .git,__pycache__,docs_rst/conf.py,tests,pymatgen/io/abinit,__init__.py
# # max-complexity = 10
# extend-ignore = E741
# max-line-length = 120

[isort]
profile=black
# [isort]
# profile=black

[pydocstyle]
ignore = D105,D2,D4
Expand Down
3 changes: 0 additions & 3 deletions src/maggma/api/resource/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# isort: off
from maggma.api.resource.core import Resource
from maggma.api.resource.core import HintScheme
from maggma.api.resource.core import HeaderProcessor

# isort: on

from maggma.api.resource.aggregation import AggregationResource
from maggma.api.resource.post_resource import PostOnlyResource
from maggma.api.resource.read_resource import ReadOnlyResource, attach_query_ops
Expand Down

0 comments on commit 7a3fad3

Please sign in to comment.