Skip to content

Commit e1c1399

Browse files
committed
Replace flake8 with ruff as well
1 parent 956cf1e commit e1c1399

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: pytest
2323
- name: Run mypy
2424
run: mypy .
25-
- name: Run flake8
26-
run: flake8
25+
- name: Run ruff check
26+
run: ruff check .
2727
- name: Run ruff format
2828
run: ruff format --check

dfn_configs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ def __init__(
287287
DfnConfig(3.0, 2.0, 0.5, 8, 0.75, 0.80, 0.55, 2.20, 0.60, 'W3020D-1,W3020D-4,WECD-1,WECD-4'),
288288
# Commented out as they coincide with the V3020D-1, only the tolerances are different,
289289
# so we may need to re-add them again later.
290-
# DfnConfig(3.0, 2.0, 0.5, 8, 0.95, 1.00, 0.40, 2.20, 0.60, 'V3020D-4,VECD-4', no_exp=False), # no nominal exp_pad
291-
# DfnConfig(3.0, 2.0, 0.5, 8, 0.75, 0.80, 0.40, 2.20, 0.60, 'W3020D-4,WECD-4', no_exp=False), # no nominal exp_pad
290+
# DfnConfig(3.0, 2.0, 0.5, 8, 0.95, 1.00, 0.40, 2.20, 0.60, 'V3020D-4,VECD-4', no_exp=False), # no nominal exp_pad
291+
# DfnConfig(3.0, 2.0, 0.5, 8, 0.75, 0.80, 0.40, 2.20, 0.60, 'W3020D-4,WECD-4', no_exp=False), # no nominal exp_pad
292292
DfnConfig(3.0, 2.0, 0.5, 10, 0.95, 1.00, 0.55, 2.20, 0.60, 'V3020D-2,VECD-2', print_pad=True),
293293
DfnConfig(3.0, 2.0, 0.5, 10, 0.75, 0.80, 0.55, 2.20, 0.60, 'W3020D-2,WECD-2'),
294294
DfnConfig(3.0, 2.0, 0.5, 10, 0.95, 1.00, 0.30, 2.20, 0.60, 'V3020D-3,VECD-3', print_pad=True),
@@ -418,7 +418,6 @@ def step_modification_sgp3x(body: Any, dot: Any, workplane: Any) -> Tuple[Any, A
418418

419419

420420
THIRD_CONFIGS = [
421-
# length, width, pitch, pin_count, height_nominal, height_max, lead_length, exposed_width, exposed_length, keywords
422421
# Sensirion
423422
DfnConfig(
424423
length=2.0,

generate_stm_mcu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def pins(self, width: int, grid: float) -> List[Tuple[str, Position, Rotation]]:
160160
Return all pins spaced with the specified grid size.
161161
"""
162162
dx = (width + 2) * grid / 2
163-
return [(l[0], Position(-dx, l[1] * grid), Rotation(0.0)) for l in self.left] + [
163+
164+
return [(l[0], Position(-dx, l[1] * grid), Rotation(0.0)) for l in self.left] + [ # noqa: E741
164165
(r[0], Position(dx, r[1] * grid), Rotation(180.0)) for r in self.right
165166
]
166167

pyproject.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ version = "0.1.0"
1515
[project.optional-dependencies]
1616
test = [
1717
"pytest ~= 8.2.1",
18-
"flake8 ~= 4.0.1",
1918
"mypy == 1.10.0",
2019
"ruff ~= 0.12.2",
2120
]
@@ -44,6 +43,18 @@ disallow_untyped_defs = false
4443
target-version = "py38"
4544
line-length = 100
4645

46+
[tool.ruff.lint.pycodestyle]
47+
# When the autoformatter fails to reduce the line length or it is disabled,
48+
# allow for a bit more
49+
max-line-length = 120
50+
51+
52+
[tool.ruff.lint]
53+
select = [
54+
"E",
55+
"F",
56+
]
57+
4758
[tool.ruff.format]
4859
quote-style = "single"
4960

test_entities.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ def test_package() -> None:
658658
'009e35ef-1f50-4bf3-ab58-11eb85bf5503',
659659
Name('Soldered Wire Connector 1x19 ⌀1.0mm'),
660660
Description(
661-
'A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\n\nGenerated with librepcb-parts-generator (generate_connectors.py)'
661+
'A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\n\n'
662+
'Generated with librepcb-parts-generator (generate_connectors.py)'
662663
),
663664
Keywords('connector, 1x19, d1.0, connector, soldering, generic'),
664665
Author('Danilo B.'),
@@ -684,7 +685,8 @@ def test_package() -> None:
684685
str(package)
685686
== """(librepcb_package 009e35ef-1f50-4bf3-ab58-11eb85bf5503
686687
(name "Soldered Wire Connector 1x19 ⌀1.0mm")
687-
(description "A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\\n\\nGenerated with librepcb-parts-generator (generate_connectors.py)")
688+
(description "A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\\n\\n"""
689+
"""Generated with librepcb-parts-generator (generate_connectors.py)")
688690
(keywords "connector, 1x19, d1.0, connector, soldering, generic")
689691
(author "Danilo B.")
690692
(version "0.1")
@@ -912,7 +914,8 @@ def test_serialized_package_line_endings(tmp_path: Path) -> None:
912914
package_uuid,
913915
Name('Soldered Wire Connector 1x19 1.0mm'),
914916
Description(
915-
'A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\n\nGenerated with librepcb-parts-generator (generate_connectors.py)'
917+
'A 1x19 soldered wire connector with 2.54mm pin spacing and 1.0mm drill holes.\n\n'
918+
'Generated with librepcb-parts-generator (generate_connectors.py)'
916919
),
917920
Keywords('connector, 1x19, d1.0, connector, soldering, generic'),
918921
Author('Danilo B.'),

0 commit comments

Comments
 (0)