create-caspian-app 1.3.6 → 1.3.7

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.
@@ -10,14 +10,18 @@ removal — but only for files that contain no component-tag import, so componen
10
10
  imports are never at risk.
11
11
 
12
12
  Flow:
13
- 1. List F401 findings under the project config (respects include/exclude).
14
- 2. Split the owning files into "component-guarded" (has >=1 import used as an
13
+ 1. Format first (`format.py`): `ruff format` for Python, djLint for the markup
14
+ inside `html(r\"\"\"...\"\"\")`. Formatting settles layout before anything
15
+ inspects the code, so the fixer and the gate report on the final shape
16
+ rather than on lines the formatter is about to move.
17
+ 2. List F401 findings under the project config (respects include/exclude).
18
+ 3. Split the owning files into "component-guarded" (has >=1 import used as an
15
19
  `<x-*>` tag) and the rest.
16
- 3. Remove dead imports only in the non-guarded files, via an isolated ruff run
20
+ 4. Remove dead imports only in the non-guarded files, via an isolated ruff run
17
21
  (`--isolated` makes F401 fixable again; `--select F401` limits it to import
18
22
  removal; explicit file args keep the run scoped).
19
- 4. Apply every other safe fix under the real project config.
20
- 5. Run the gate (`check.py`) and exit with its status.
23
+ 5. Apply every other safe fix under the real project config.
24
+ 6. Run the gate (`check.py`) and exit with its status.
21
25
  """
22
26
 
23
27
  from __future__ import annotations
@@ -77,7 +81,21 @@ def _remove_dead_imports() -> list[str]:
77
81
  return fixable_files
78
82
 
79
83
 
84
+ def _format() -> None:
85
+ """Run the formatter, but never let it block the fixer or the gate.
86
+
87
+ A formatting problem (a missing djLint, an unformattable block) must not
88
+ stop dead imports from being removed or the gate from reporting. `format.py`
89
+ prints its own summary, including anything it skipped.
90
+ """
91
+ subprocess.run(
92
+ [sys.executable, str(PROJECT_ROOT / "settings" / "format.py")],
93
+ cwd=PROJECT_ROOT,
94
+ )
95
+
96
+
80
97
  def main() -> int:
98
+ _format()
81
99
  _remove_dead_imports()
82
100
  # Every other safe fix under the real project config. F401 stays unfixable
83
101
  # here (dead imports were already handled above), so component imports are