Skip to content

Commit c003b45

Browse files
Move Import Linter config to .importlinter to reduce clutter (#1279)
1 parent 8130abd commit c003b45

2 files changed

Lines changed: 126 additions & 127 deletions

File tree

.importlinter

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
[importlinter]
2+
root_packages =
3+
usethis
4+
5+
[importlinter:contract:usethis]
6+
name = usethis
7+
type = layers
8+
containers =
9+
usethis
10+
layers =
11+
_test | __main__
12+
_ui
13+
_toolset
14+
_core
15+
_tool
16+
_init
17+
_deps
18+
_config_file
19+
_integrations
20+
_io | _subprocess | _console
21+
_config
22+
_types | errors
23+
_pipeweld
24+
exhaustive = true
25+
exhaustive_ignores =
26+
_version
27+
28+
[importlinter:contract:ui]
29+
name = usethis._ui
30+
type = layers
31+
containers =
32+
usethis._ui
33+
layers =
34+
app
35+
interface
36+
options
37+
exhaustive = true
38+
39+
[importlinter:contract:core]
40+
name = usethis._core
41+
type = layers
42+
containers =
43+
usethis._core
44+
layers =
45+
badge | docstyle | list | rule
46+
author | browse | ci | readme | show | status | tool
47+
exhaustive = true
48+
49+
[importlinter:contract:tool]
50+
name = usethis._tool
51+
type = layers
52+
containers =
53+
usethis._tool
54+
layers =
55+
all_
56+
impl
57+
base
58+
config | pre_commit | rule
59+
exhaustive = true
60+
61+
[importlinter:contract:tool_impl]
62+
name = usethis._tool.impl
63+
type = layers
64+
containers =
65+
usethis._tool.impl
66+
layers =
67+
pyproject_toml
68+
codespell | deptry | import_linter | pyproject_fmt | requirements_txt
69+
ruff
70+
pytest : coverage_py
71+
pre_commit | mkdocs
72+
exhaustive = true
73+
74+
[importlinter:contract:integrations]
75+
name = usethis._integrations
76+
type = layers
77+
containers =
78+
usethis._integrations
79+
layers =
80+
ci | pre_commit
81+
environ
82+
backend | mkdocs | pytest | pydantic | sonarqube
83+
project
84+
file
85+
python
86+
exhaustive = true
87+
88+
[importlinter:contract:integrations_file]
89+
name = usethis._integrations.file
90+
type = layers
91+
containers =
92+
usethis._integrations.file
93+
layers =
94+
pyproject_toml | setup_cfg
95+
ini | toml | yaml
96+
dir
97+
exhaustive = true
98+
99+
[importlinter:contract:ui_interface]
100+
name = usethis._ui.interface
101+
type = layers
102+
containers =
103+
usethis._ui.interface
104+
layers =
105+
author | badge | browse | ci | doc | docstyle | format_ | init | lint | list | readme | rule | show | spellcheck | status | test | tool | version
106+
exhaustive = true
107+
108+
[importlinter:contract:pipeweld]
109+
name = usethis._pipeweld
110+
type = layers
111+
containers =
112+
usethis._pipeweld
113+
layers =
114+
func
115+
result
116+
containers | ops
117+
exhaustive = true
118+
119+
[importlinter:contract:integrations_ci]
120+
name = usethis._integrations.ci
121+
type = layers
122+
containers =
123+
usethis._integrations.ci
124+
layers =
125+
bitbucket | github
126+
exhaustive = true

pyproject.toml

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -236,132 +236,5 @@ reportUnusedFunction = false
236236
reportUnusedCallResult = false
237237
reportUnusedParameter = false
238238

239-
[tool.importlinter]
240-
root_packages = [ "usethis" ]
241-
242-
[[tool.importlinter.contracts]]
243-
name = "usethis"
244-
type = "layers"
245-
layers = [
246-
"_test | __main__",
247-
"_ui",
248-
# Tool implementations
249-
"_toolset",
250-
"_core",
251-
"_tool",
252-
# Specific config file and backend implementations
253-
"_init",
254-
"_deps",
255-
"_config_file",
256-
"_integrations",
257-
"_io | _subprocess | _console",
258-
# Global state and constants
259-
"_config",
260-
"_types | errors",
261-
# Completely independent helper modules
262-
"_pipeweld",
263-
]
264-
containers = [ "usethis" ]
265-
exhaustive = true
266-
exhaustive_ignores = [ "_version" ]
267-
268-
[[tool.importlinter.contracts]]
269-
name = "usethis._ui"
270-
type = "layers"
271-
layers = [
272-
"app",
273-
"interface",
274-
"options",
275-
]
276-
containers = [ "usethis._ui" ]
277-
exhaustive = true
278-
279-
[[tool.importlinter.contracts]]
280-
name = "usethis._core"
281-
type = "layers"
282-
layers = [
283-
# docstyle uses (Ruff) tool, badge uses readme
284-
"badge | docstyle | list | rule",
285-
"author | browse | ci | readme | show | status | tool",
286-
]
287-
containers = [ "usethis._core" ]
288-
exhaustive = true
289-
290-
[[tool.importlinter.contracts]]
291-
name = "usethis._tool"
292-
type = "layers"
293-
layers = [
294-
"all_",
295-
"impl",
296-
"base",
297-
"config | pre_commit | rule",
298-
]
299-
containers = [ "usethis._tool" ]
300-
exhaustive = true
301-
302-
[[tool.importlinter.contracts]]
303-
name = "usethis._tool.impl"
304-
type = "layers"
305-
layers = [
306-
"pyproject_toml",
307-
"codespell | deptry | import_linter | pyproject_fmt | requirements_txt",
308-
"ruff",
309-
"pytest : coverage_py",
310-
"pre_commit | mkdocs",
311-
]
312-
containers = [ "usethis._tool.impl" ]
313-
exhaustive = true
314-
315-
[[tool.importlinter.contracts]]
316-
name = "usethis._integrations"
317-
type = "layers"
318-
layers = [
319-
"ci | pre_commit",
320-
"environ",
321-
"backend | mkdocs | pytest | pydantic | sonarqube",
322-
"project",
323-
"file",
324-
"python",
325-
]
326-
containers = [ "usethis._integrations" ]
327-
exhaustive = true
328-
329-
[[tool.importlinter.contracts]]
330-
name = "usethis._integrations.file"
331-
type = "layers"
332-
layers = [
333-
"pyproject_toml | setup_cfg",
334-
"ini | toml | yaml",
335-
"dir",
336-
]
337-
containers = [ "usethis._integrations.file" ]
338-
exhaustive = true
339-
340-
[[tool.importlinter.contracts]]
341-
name = "usethis._ui.interface"
342-
type = "layers"
343-
layers = [
344-
# Note; if you're adding an interface, make sure it's in the README too.
345-
"author | badge | browse | ci | doc | docstyle | format_ | init | lint | list | readme | rule | show | spellcheck | status | test | tool | version",
346-
]
347-
containers = [ "usethis._ui.interface" ]
348-
exhaustive = true
349-
350-
[[tool.importlinter.contracts]]
351-
name = "usethis._pipeweld"
352-
type = "layers"
353-
layers = [ "func", "result", "containers | ops" ]
354-
containers = [ "usethis._pipeweld" ]
355-
exhaustive = true
356-
357-
[[tool.importlinter.contracts]]
358-
name = "usethis._integrations.ci"
359-
type = "layers"
360-
layers = [
361-
"bitbucket | github",
362-
]
363-
containers = [ "usethis._integrations.ci" ]
364-
exhaustive = true
365-
366239
[tool.sync-with-uv.repo-to-package]
367240
"https://github.com/astral-sh/uv-pre-commit" = "uv"

0 commit comments

Comments
 (0)