Skip to content

Commit 1bedfca

Browse files
authored
Merge pull request #234 from seddonym/add-import-linter-contract
Add import linter contract
2 parents 073b269 + fe5db0f commit 1bedfca

5 files changed

Lines changed: 24 additions & 150 deletions

File tree

.importlinter

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[importlinter]
2+
root_package = grimp
3+
4+
[importlinter:contract:1]
5+
name=Layered architecture
6+
type=layers
7+
containers =
8+
grimp
9+
layers=
10+
main
11+
adaptors
12+
application
13+
domain
14+
exceptions
15+
exhaustive = true
16+
ignore_imports =
17+
; Grimp doesn't understand extension modules: it thinks grimp._rustgrimp
18+
; is an object within grimp, rather than a module in its own right,
19+
; so we ignore these imports here.
20+
grimp.adaptors.graph -> grimp
21+
grimp.adaptors.importscanner -> grimp
22+
grimp.adaptors.filesystem -> grimp

src/grimp/algorithms/__init__.py

Whitespace-only changes.

src/grimp/algorithms/shortest_path.py

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/grimp/helpers.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ basepython = py313
5151
deps =
5252
black==23.9.1
5353
flake8==7.1.1
54+
import-linter==2.3
5455
mypy==1.11.2
5556
pytest-stub==1.1.0
5657
types-pyyaml==6.0.12.20240917
57-
skip_install = true
5858
commands =
5959
black --check src tests
6060
flake8 src tests
6161
mypy src/grimp tests
62+
lint-imports
6263

6364
[testenv:benchmark]
6465
basepython = py313

0 commit comments

Comments
 (0)