Skip to content

Commit d777387

Browse files
Merge pull request #8 from PlasmaFAIR/ci/linting
Add linting workflow
2 parents 536aa60 + 53f01ab commit d777387

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

.github/workflows/lint.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.py'
7+
pull_request:
8+
paths:
9+
- '**.py'
10+
11+
jobs:
12+
Linting:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.x
19+
- name: Install Project
20+
run: |
21+
python -m pip install --upgrade pip
22+
python -m pip install .[lint]
23+
- name: Run Black
24+
if: always()
25+
run: |
26+
black --check --verbose src tests
27+
- name: Run Ruff
28+
if: always()
29+
run: |
30+
ruff src
31+
- name: Run MyPy
32+
if: always()
33+
run: |
34+
mypy src

src/pyloidal/cocos.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
@dataclass(frozen=True)
3333
class Sigma:
34-
"""Collection of signs of various quantities"""
34+
"""Collection of signs of various quantities."""
3535

3636
B_poloidal: int
3737
r_phi_z: int
@@ -167,7 +167,7 @@ def identify_cocos(
167167
sigma_rpz = -1 if clockwise_phi else 1
168168
sigma_rtp = sign_q * sign_plasma_current * sign_b_toroidal
169169

170-
# identify 2*pi term in poloidal_flux definition based on safety_factor estimate
170+
# identify 2*pi term in poloidal_flux definition based on safety_factor estimate.
171171
if minor_radii is None:
172172
# Return both variants if not provided with minor radii
173173
return tuple(

0 commit comments

Comments
 (0)