Skip to content

Commit a004127

Browse files
committed
fix lint, exit code
1 parent 0923d02 commit a004127

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

.flake8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E203,E266,E302,E501,W503
2+
ignore = E203,E266,E302,E501,W503,E231,E713
33
exclude =
44
.git,
55
__pycache__,
@@ -8,4 +8,4 @@ exclude =
88
venv/,
99
nldiff/__init__.py,
1010
parsetab.py,
11-
parser.out
11+
parser.out

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
- name: Install Linters
1818
run: make venv
1919
- name: Lint
20-
run: make lint
20+
run: |
21+
source ./venv/bin/activate
22+
make lint
2123
push_to_pypi:
2224
name: Build (and publish, if applicable)
2325
runs-on: ubuntu-22.04

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ dist: venv/manifest.txt
77
lint:
88
black --check .
99
flake8 .
10-
mypy --check-untyped-defs .
1110

1211
venv: venv/manifest.txt
1312
venv/manifest.txt: ./pyproject.toml

nldiff/__main__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ def diff(first_nl: str, second_nl: str) -> bool:
4747
print(f"The second netlist is not supported: {e}")
4848
exit(os.EX_DATAERR)
4949

50-
for difference in metadata_1.diff(metadata_2):
50+
differences = metadata_1.diff(metadata_2)
51+
for difference in differences:
5152
print(difference)
5253

54+
if len(differences):
55+
exit(1)
56+
else:
57+
exit(0)
58+
5359

5460
@click.command()
5561
@click.argument("first_nl")

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pyverilog = "*"
2222
[tool.poetry.group.dev.dependencies]
2323
wheel = "*"
2424
black = ">=24.4.0,<25"
25-
flake8 = ">=4"
25+
flake8 = "*"
2626

2727
[tool.poetry.scripts]
2828
nldiff = "nldiff.__main__:diff_cmd"

0 commit comments

Comments
 (0)