forked from wemake-services/wemake-python-styleguide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.importlinter
107 lines (81 loc) · 2.36 KB
/
.importlinter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
[importlinter]
root_package = wemake_python_styleguide
include_external_packages = True
[importlinter:contract:layers]
name = Layered architecture of our linter
type = layers
containers =
wemake_python_styleguide
layers =
checker
formatter
transformations
presets
visitors
violations
logic
compat
options
constants
types
# TODO: provide independence contract for visitors
[importlinter:contract:violation-independence]
name = Independence contract for violations (all shall be free!)
type = independence
modules =
wemake_python_styleguide.violations.system
wemake_python_styleguide.violations.naming
wemake_python_styleguide.violations.complexity
wemake_python_styleguide.violations.consistency
wemake_python_styleguide.violations.best_practices
wemake_python_styleguide.violations.refactoring
wemake_python_styleguide.violations.oop
[importlinter:contract:flake8-independence]
name = Independence contract for flake8 API (all shall be free!)
type = independence
modules =
wemake_python_styleguide.checker
wemake_python_styleguide.formatter
[importlinter:contract:api-restrictions]
name = Forbids to import anything from dependencies
type = forbidden
source_modules =
wemake_python_styleguide
forbidden_modules =
# Std imports we don't like:
dataclasses
# Important direct and indirect dependencies:
flake8
pygments
pyflakes
pycodestyle
mccabe
astboom
tokelor
ignore_imports =
# These modules must import from flake8 to provide required API:
wemake_python_styleguide.checker -> flake8
wemake_python_styleguide.formatter -> flake8
wemake_python_styleguide.options.config -> flake8
# We disallow direct imports of our dependencies from anywhere, except:
wemake_python_styleguide.formatter -> pygments
[importlinter:contract:subapi-restrictions]
name = Forbids to import anything from our sub-API packages
type = forbidden
source_modules =
wemake_python_styleguide.visitors
wemake_python_styleguide.violations
wemake_python_styleguide.compat
wemake_python_styleguide.logic
forbidden_modules =
# Our sub-API parts:
wemake_python_styleguide.options
wemake_python_styleguide.transformations
wemake_python_styleguide.presets
[importlinter:contract:tests-restrictions]
name = Explicit import restrictions for tests
type = forbidden
source_modules =
wemake_python_styleguide
forbidden_modules =
tests