diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index eb532160d..2ca0a5476 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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 diff --git a/requirements-testing.txt b/requirements-testing.txt index 6569e943f..6dc1a186b 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -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 diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 000000000..8fc903032 --- /dev/null +++ b/ruff.toml @@ -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" +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 140b52323..71d54f0f2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/src/maggma/api/resource/__init__.py b/src/maggma/api/resource/__init__.py index 4c277caeb..d04b04957 100644 --- a/src/maggma/api/resource/__init__.py +++ b/src/maggma/api/resource/__init__.py @@ -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