@biffo/cli 0.347.0 → 0.349.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,11 +94,21 @@ line-length = 100
94
94
  # place: ANN401 rejects the `Any` in a Pydantic mode="before" validator, which
95
95
  # is the one signature where `Any` is genuinely correct.
96
96
  [tool.ruff.lint]
97
- select = ["E", "F", "I", "N", "W", "B", "S", "UP"]
97
+ select = ["E", "F", "I", "N", "W", "B", "S", "UP", "TID251"]
98
98
  ignore = [
99
99
  "S101", # allow assert in tests
100
100
  ]
101
101
 
102
+ # `src.<pkg>` imports resolve in this repo only if something puts the repo root on
103
+ # sys.path, then fail with ModuleNotFoundError once the plugin is vendored to
104
+ # services/<name>/ (services/api's own `src` package claims the name first, so
105
+ # the failure only shows when an API test runs earlier in the same session).
106
+ # Import by the package name (`from <pkg>.<mod> import x`) instead. TID251 matches
107
+ # the module and every submodule beneath it, so `from src.<pkg>.<mod> import x`
108
+ # is rejected too. Enforced by `ruff check .` in ci.yml and in pre-push `verify`.
109
+ [tool.ruff.lint.flake8-tidy-imports.banned-api]
110
+ "src".msg = "Import by package name (`from <pkg>.<mod> import x`), not through `src.`: it fails once the plugin is vendored into an instance."
111
+
102
112
  # FastAPI's dependency-injection defaults are the framework's idiomatic
103
113
  # call-in-default pattern, not the B008 mutable-default bug. Without this a
104
114
  # plugin cannot write `x = Depends(...)` — the mandatory idiom for any plugin
@@ -0,0 +1,46 @@
1
+ """The TID251 `src` ban rejects `src.<pkg>.<mod>` imports and accepts `<pkg>.<mod>`."""
2
+
3
+ import json
4
+ import subprocess
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ ROOT = Path(__file__).resolve().parent.parent
9
+
10
+
11
+ def _tid251(tmp_path: Path, source: str) -> list[dict]:
12
+ f = tmp_path / "probe.py"
13
+ f.write_text(source)
14
+ out = subprocess.run( # noqa: S603
15
+ [
16
+ sys.executable,
17
+ "-m",
18
+ "ruff",
19
+ "check",
20
+ "--config",
21
+ str(ROOT / "pyproject.toml"),
22
+ "--no-cache",
23
+ "--select",
24
+ "TID251",
25
+ "--output-format",
26
+ "json",
27
+ str(f),
28
+ ],
29
+ capture_output=True,
30
+ text=True,
31
+ check=False,
32
+ )
33
+ return json.loads(out.stdout)
34
+
35
+
36
+ def test_submodule_src_import_is_rejected(tmp_path):
37
+ assert _tid251(tmp_path, "from src.pkg.mod import x\n")
38
+
39
+
40
+ def test_plain_and_dotted_src_imports_are_rejected(tmp_path):
41
+ assert _tid251(tmp_path, "import src\n")
42
+ assert _tid251(tmp_path, "import src.pkg.mod\n")
43
+
44
+
45
+ def test_package_name_import_is_accepted(tmp_path):
46
+ assert _tid251(tmp_path, "from pkg.mod import x\n") == []
@@ -32,7 +32,8 @@
32
32
  },
33
33
  "pnpm": {
34
34
  "overrides": {
35
- "brace-expansion@<5.0.9": ">=5.0.9",
35
+ "brace-expansion@<5.0.12": ">=5.0.12",
36
+ "undici@<8.10.2": ">=8.10.2",
36
37
  "js-yaml@<4.3.2": ">=4.3.2 <5",
37
38
  "nanoid@<3.3.17": ">=3.3.17 <4"
38
39
  }
@@ -5,7 +5,8 @@ settings:
5
5
  excludeLinksFromLockfile: false
6
6
 
7
7
  overrides:
8
- brace-expansion@<5.0.9: '>=5.0.9'
8
+ brace-expansion@<5.0.12: '>=5.0.12'
9
+ undici@<8.10.2: '>=8.10.2'
9
10
  js-yaml@<4.3.2: '>=4.3.2 <5'
10
11
  nanoid@<3.3.17: '>=3.3.17 <4'
11
12
 
@@ -791,8 +792,8 @@ packages:
791
792
  bidi-js@1.1.0:
792
793
  resolution: {integrity: sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==}
793
794
 
794
- brace-expansion@5.0.9:
795
- resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==}
795
+ brace-expansion@5.0.12:
796
+ resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==}
796
797
  engines: {node: 20 || >=22}
797
798
 
798
799
  browserslist@4.28.9:
@@ -2134,7 +2135,7 @@ snapshots:
2134
2135
  dependencies:
2135
2136
  require-from-string: 2.0.2
2136
2137
 
2137
- brace-expansion@5.0.9:
2138
+ brace-expansion@5.0.12:
2138
2139
  dependencies:
2139
2140
  balanced-match: 4.0.4
2140
2141
 
@@ -2457,11 +2458,11 @@ snapshots:
2457
2458
 
2458
2459
  minimatch@10.2.6:
2459
2460
  dependencies:
2460
- brace-expansion: 5.0.9
2461
+ brace-expansion: 5.0.12
2461
2462
 
2462
2463
  minimatch@3.1.5:
2463
2464
  dependencies:
2464
- brace-expansion: 5.0.9
2465
+ brace-expansion: 5.0.12
2465
2466
 
2466
2467
  ms@2.1.3: {}
2467
2468
 
@@ -34,7 +34,8 @@
34
34
  },
35
35
  "pnpm": {
36
36
  "overrides": {
37
- "brace-expansion@<5.0.9": ">=5.0.9",
37
+ "brace-expansion@<5.0.12": ">=5.0.12",
38
+ "undici@<8.10.2": ">=8.10.2",
38
39
  "js-yaml@<4.3.2": ">=4.3.2 <5",
39
40
  "nanoid@<3.3.17": ">=3.3.17 <4"
40
41
  }
@@ -5,7 +5,8 @@ settings:
5
5
  excludeLinksFromLockfile: false
6
6
 
7
7
  overrides:
8
- brace-expansion@<5.0.9: '>=5.0.9'
8
+ brace-expansion@<5.0.12: '>=5.0.12'
9
+ undici@<8.10.2: '>=8.10.2'
9
10
  js-yaml@<4.3.2: '>=4.3.2 <5'
10
11
  nanoid@<3.3.17: '>=3.3.17 <4'
11
12
 
@@ -829,8 +830,8 @@ packages:
829
830
  bidi-js@1.0.3:
830
831
  resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==}
831
832
 
832
- brace-expansion@5.0.9:
833
- resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==}
833
+ brace-expansion@5.0.12:
834
+ resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==}
834
835
  engines: {node: 20 || >=22}
835
836
 
836
837
  browserslist@4.28.8:
@@ -951,6 +952,7 @@ packages:
951
952
  eslint@9.39.5:
952
953
  resolution: {integrity: sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==}
953
954
  engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
955
+ deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
954
956
  hasBin: true
955
957
  peerDependencies:
956
958
  jiti: '*'
@@ -1403,8 +1405,8 @@ packages:
1403
1405
  undici-types@8.3.0:
1404
1406
  resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==}
1405
1407
 
1406
- undici@8.10.0:
1407
- resolution: {integrity: sha512-HvltHd7avK13QIw/oLe4qoOLyoVSoafqJ2jYOrtMRBkbYT31eiBQ8O0ehRKZiEZCMEyLFQNIADpgCWC5fALvYQ==}
1408
+ undici@8.11.2:
1409
+ resolution: {integrity: sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==}
1408
1410
  engines: {node: '>=22.19.0'}
1409
1411
 
1410
1412
  unfetch@4.2.0:
@@ -2263,7 +2265,7 @@ snapshots:
2263
2265
  dependencies:
2264
2266
  require-from-string: 2.0.2
2265
2267
 
2266
- brace-expansion@5.0.9:
2268
+ brace-expansion@5.0.12:
2267
2269
  dependencies:
2268
2270
  balanced-match: 4.0.4
2269
2271
 
@@ -2555,7 +2557,7 @@ snapshots:
2555
2557
  saxes: 6.0.0
2556
2558
  symbol-tree: 3.2.4
2557
2559
  tough-cookie: 6.0.2
2558
- undici: 8.10.0
2560
+ undici: 8.11.2
2559
2561
  w3c-xmlserializer: 5.0.0
2560
2562
  webidl-conversions: 8.0.1
2561
2563
  whatwg-mimetype: 5.0.0
@@ -2607,11 +2609,11 @@ snapshots:
2607
2609
 
2608
2610
  minimatch@10.2.6:
2609
2611
  dependencies:
2610
- brace-expansion: 5.0.9
2612
+ brace-expansion: 5.0.12
2611
2613
 
2612
2614
  minimatch@3.1.5:
2613
2615
  dependencies:
2614
- brace-expansion: 5.0.9
2616
+ brace-expansion: 5.0.12
2615
2617
 
2616
2618
  ms@2.1.3: {}
2617
2619
 
@@ -2822,7 +2824,7 @@ snapshots:
2822
2824
 
2823
2825
  undici-types@8.3.0: {}
2824
2826
 
2825
- undici@8.10.0: {}
2827
+ undici@8.11.2: {}
2826
2828
 
2827
2829
  unfetch@4.2.0: {}
2828
2830
 
@@ -44,8 +44,9 @@
44
44
  "overrides": {
45
45
  "postcss@<8.5.18": ">=8.5.18",
46
46
  "sharp@<0.35.4": ">=0.35.4",
47
- "brace-expansion@<5.0.9": ">=5.0.9",
47
+ "brace-expansion@<5.0.12": ">=5.0.12",
48
48
  "undici@<7.29.0": ">=7.29.0",
49
+ "undici@<8.10.2": ">=8.10.2",
49
50
  "js-yaml@<4.3.2": ">=4.3.2 <5",
50
51
  "nanoid@<3.3.17": ">=3.3.17 <4",
51
52
  "browserslist@<4.28.7": ">=4.28.7"
@@ -7,8 +7,9 @@ settings:
7
7
  overrides:
8
8
  postcss@<8.5.18: '>=8.5.18'
9
9
  sharp@<0.35.4: '>=0.35.4'
10
- brace-expansion@<5.0.9: '>=5.0.9'
10
+ brace-expansion@<5.0.12: '>=5.0.12'
11
11
  undici@<7.29.0: '>=7.29.0'
12
+ undici@<8.10.2: '>=8.10.2'
12
13
  js-yaml@<4.3.2: '>=4.3.2 <5'
13
14
  nanoid@<3.3.17: '>=3.3.17 <4'
14
15
  browserslist@<4.28.7: '>=4.28.7'
@@ -1239,8 +1240,8 @@ packages:
1239
1240
  bidi-js@1.0.3:
1240
1241
  resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==}
1241
1242
 
1242
- brace-expansion@5.0.9:
1243
- resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==}
1243
+ brace-expansion@5.0.12:
1244
+ resolution: {integrity: sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==}
1244
1245
  engines: {node: 20 || >=22}
1245
1246
 
1246
1247
  braces@3.0.3:
@@ -2457,8 +2458,8 @@ packages:
2457
2458
  undici-types@6.21.0:
2458
2459
  resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
2459
2460
 
2460
- undici@8.10.0:
2461
- resolution: {integrity: sha512-HvltHd7avK13QIw/oLe4qoOLyoVSoafqJ2jYOrtMRBkbYT31eiBQ8O0ehRKZiEZCMEyLFQNIADpgCWC5fALvYQ==}
2461
+ undici@8.11.2:
2462
+ resolution: {integrity: sha512-u4UB2/IrKdU6lFxumHmmo1a3fCQO5tzQllRorfoRS63txhrB7xTpSn1PftwC4qEHkOaqP95fCWW4lJzwErwzhQ==}
2462
2463
  engines: {node: '>=22.19.0'}
2463
2464
 
2464
2465
  unfetch@4.2.0:
@@ -3673,7 +3674,7 @@ snapshots:
3673
3674
  dependencies:
3674
3675
  require-from-string: 2.0.2
3675
3676
 
3676
- brace-expansion@5.0.9:
3677
+ brace-expansion@5.0.12:
3677
3678
  dependencies:
3678
3679
  balanced-match: 4.0.4
3679
3680
 
@@ -3978,8 +3979,8 @@ snapshots:
3978
3979
  '@typescript-eslint/parser': 8.62.1(eslint@9.39.4)(typescript@5.9.3)
3979
3980
  eslint: 9.39.4
3980
3981
  eslint-import-resolver-node: 0.3.10
3981
- eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4)
3982
- eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4)
3982
+ eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4)
3983
+ eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4)
3983
3984
  eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.4)
3984
3985
  eslint-plugin-react: 7.37.5(eslint@9.39.4)
3985
3986
  eslint-plugin-react-hooks: 5.2.0(eslint@9.39.4)
@@ -3998,7 +3999,7 @@ snapshots:
3998
3999
  transitivePeerDependencies:
3999
4000
  - supports-color
4000
4001
 
4001
- eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4):
4002
+ eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4):
4002
4003
  dependencies:
4003
4004
  '@nolyfill/is-core-module': 1.0.39
4004
4005
  debug: 4.4.3
@@ -4009,22 +4010,22 @@ snapshots:
4009
4010
  tinyglobby: 0.2.17
4010
4011
  unrs-resolver: 1.12.2
4011
4012
  optionalDependencies:
4012
- eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4)
4013
+ eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4)
4013
4014
  transitivePeerDependencies:
4014
4015
  - supports-color
4015
4016
 
4016
- eslint-module-utils@2.14.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4):
4017
+ eslint-module-utils@2.14.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4):
4017
4018
  dependencies:
4018
4019
  debug: 3.2.7
4019
4020
  optionalDependencies:
4020
4021
  '@typescript-eslint/parser': 8.62.1(eslint@9.39.4)(typescript@5.9.3)
4021
4022
  eslint: 9.39.4
4022
4023
  eslint-import-resolver-node: 0.3.10
4023
- eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4)
4024
+ eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4)
4024
4025
  transitivePeerDependencies:
4025
4026
  - supports-color
4026
4027
 
4027
- eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4):
4028
+ eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4):
4028
4029
  dependencies:
4029
4030
  '@rtsao/scc': 1.1.0
4030
4031
  array-includes: 3.1.9
@@ -4035,7 +4036,7 @@ snapshots:
4035
4036
  doctrine: 2.1.0
4036
4037
  eslint: 9.39.4
4037
4038
  eslint-import-resolver-node: 0.3.10
4038
- eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4)
4039
+ eslint-module-utils: 2.14.0(@typescript-eslint/parser@8.62.1(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4)
4039
4040
  hasown: 2.0.4
4040
4041
  is-core-module: 2.16.2
4041
4042
  is-glob: 4.0.3
@@ -4505,7 +4506,7 @@ snapshots:
4505
4506
  saxes: 6.0.0
4506
4507
  symbol-tree: 3.2.4
4507
4508
  tough-cookie: 6.0.2
4508
- undici: 8.10.0
4509
+ undici: 8.11.2
4509
4510
  w3c-xmlserializer: 5.0.0
4510
4511
  webidl-conversions: 8.0.1
4511
4512
  whatwg-mimetype: 5.0.0
@@ -4587,11 +4588,11 @@ snapshots:
4587
4588
 
4588
4589
  minimatch@10.2.5:
4589
4590
  dependencies:
4590
- brace-expansion: 5.0.9
4591
+ brace-expansion: 5.0.12
4591
4592
 
4592
4593
  minimatch@3.1.5:
4593
4594
  dependencies:
4594
- brace-expansion: 5.0.9
4595
+ brace-expansion: 5.0.12
4595
4596
 
4596
4597
  minimist@1.2.8: {}
4597
4598
 
@@ -5158,7 +5159,7 @@ snapshots:
5158
5159
 
5159
5160
  undici-types@6.21.0: {}
5160
5161
 
5161
- undici@8.10.0: {}
5162
+ undici@8.11.2: {}
5162
5163
 
5163
5164
  unfetch@4.2.0: {}
5164
5165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.347.0",
3
+ "version": "0.349.0",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",