Skip to content

Commit f6d049e

Browse files
committed
MAINT: switch from flake8 (via pytest-flake8) to ruff for linting
1 parent f803fa5 commit f6d049e

File tree

3 files changed

+45
-14
lines changed

3 files changed

+45
-14
lines changed

.github/workflows/test-larray-editor.yml renamed to .github/workflows/ci.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1-
name: Test LArray Editor
1+
name: CI
22

33
# Triggers the workflow on push or pull request events
44
on: [push, pull_request]
55

66
jobs:
7-
build-linux:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Install Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: "3.11"
17+
18+
# Pin ruff version to make sure we do not break our builds at the worst times
19+
- name: Install Ruff 0.0.244
20+
run: pip install ruff==0.0.244
21+
22+
# Include `--format=github` to enable automatic inline annotations.
23+
- name: Run Ruff
24+
run: ruff check --format=github .
25+
26+
test:
827
# name: Test (${{ matrix.python-version }}, ${{ matrix.os }})
9-
name: Test on ${{ matrix.python-version }}
1028
# runs-on: ${{ matrix.os }}
29+
name: Test on ${{ matrix.python-version }}
1130
runs-on: ubuntu-latest
1231
strategy:
1332
max-parallel: 5
@@ -31,10 +50,4 @@ jobs:
3150
- run: conda info
3251
- run: conda list
3352
- run: conda config --show
34-
# - name: Lint with flake8
35-
# run: |
36-
# # stop the build if there are Python syntax errors or undefined names
37-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
39-
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4053
- run: pytest

environment.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ channels:
33
- defaults
44
- larray-project
55
dependencies:
6-
- pip
76
- larray
87
- pyqt >=5
98
- qtpy >=2
10-
- matplotlib
119
- pytables
10+
- matplotlib
1211
- pytest>=3.5
13-
- flake8
14-
- pip:
15-
- pytest-flake8

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.ruff]
2+
# Enable Pyflakes `E` and `F` codes by default.
3+
select = ["E", "F"]
4+
ignore = []
5+
6+
# Allow autofix for all enabled rules (when `--fix`) is provided.
7+
# fixable = ["A", "B", "C", "D", "E", "F", "..."]
8+
# unfixable = []
9+
10+
# Exclude a variety of commonly ignored directories.
11+
exclude = [
12+
".eggs",
13+
".git",
14+
".ruff_cache",
15+
".venv",
16+
"__pypackages__",
17+
"build",
18+
"dist",
19+
]
20+
per-file-ignores = {}
21+
22+
line-length = 120

0 commit comments

Comments
 (0)