Skip to content

Commit

Permalink
replace flake8 with ruff (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Dec 4, 2022
1 parent 745268f commit 8825898
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

20 changes: 11 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@ jobs:
- name: run isort
run: |
isort --check-only --quiet .
flake8:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install flake8
python-version: "3.10"
- name: Install dependencies
run: |
pip install flake8==4.0.1
- name: run flake8
run: |
flake8 . --count --show-source --statistics
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: ruff .

pylint-disabled:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ repos:
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.133
hooks:
- id: flake8
additional_dependencies: [flake8-isort]
- id: ruff
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ black
znvis
ase
astroid
ruff
2 changes: 1 addition & 1 deletion docs/source/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ some resources to help you get started and avoid making some of the same mistake
Code Style
-----------

MDSuite uses `Black <https://github.com/psf/black>`_, `Isort <https://github.com/PyCQA/isort>`_ and `flake8 <https://github.com/PyCQA/flake8>`_.
MDSuite uses `Black <https://github.com/psf/black>`_, `Isort <https://github.com/PyCQA/isort>`_ and `ruff <https://github.com/charliermarsh/ruff>`_.
We provide a pre-commit hook to check these requirements.
One can install the hook via

Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ preview = true
[tool.isort]
profile = 'black'
multi_line_output = 3

[tool.ruff]
line-length = 90

select = ["E", "F", "D", "N", "C"]
extend-ignore = [
"D213", "D203",
"D100", "D101", "D102", "D103", "D105", "D107",
"D200", "D202", "D205", "D207", "D212",
"D400", "D404", "D405", "D406", "D407", "D409", "D410", "D411", "D412", "D413", "D414", "D415", "D416", "D417",
"C400", "C408", "C410", "C416",
"C901",
"N802", "N803", "N806", "N818"
]

exclude = [
"tmp",
"docs",
]

0 comments on commit 8825898

Please sign in to comment.