djust 0.7.3rc1

Pre-releaseReleased

Changed

  • djust_theming.W001 contrast-checks the active preset only by default (v0.7.3, #1005)check_preset_contrast previously iterated get_registry().list_presets().items() and ran WCAG AA contrast checks on every registered preset × mode × token pair. With djust's 65+ built-in presets, that produced hundreds of warnings on every manage.py check / pod start (in one observed project: 491 issues → ~480 W001 noise + ~11 real). The S/N ratio was bad enough that the warnings got ignored, which is the opposite of what you want from a check. Fix: new _contrast_check_scope() helper reads DJUST_THEMING.contrast_check_scope (default: "active") and the active scope iterates only the preset configured in LIVEVIEW_CONFIG.theme.preset — same setting check_preset_valid reads. Theme-pack authors who want the full exhaustive sweep opt in via:

    DJUST_THEMING = {"contrast_check_scope": "all"}
    

    Unknown values fall back to "active" (signal-preserving). When the configured preset is missing from the registry, the check yields zero warnings — check_preset_valid already fires E002 for that misconfiguration, so we don't double-warn. Behavior change for existing users: dropping into the "active" default silences hundreds of warnings about presets the project never uses; real W001 hits on the active preset still surface as before. Covered by 4 new regression tests (active-only default, opt-in all-scope, missing-active-preset edge case, unknown-scope-value fallback) plus 6 existing tests updated to opt into the exhaustive scope (they exercise the loop body, not the scope selector).

Fixed

  • djust.A070 no longer false-positives on {% verbatim %}-wrapped dj_activity examples (v0.7.3, #1004) — the A070 / A071 scanner walks template source as raw text. Templates that document the {% dj_activity %} tag — common pattern on docs / marketing pages that include literal example markup wrapped in {% verbatim %} so Django renders the example as-is — got flagged as real uninstrumented activity calls. Fix: new _strip_verbatim_blocks(content) helper redacts the BODY of every {% verbatim %}...{% endverbatim %} region (both unnamed and Django's named-form {% verbatim foo %}...{% endverbatim foo %}) before the regex scan. Newlines inside the region are preserved so line numbers from match.start() stay accurate for matches OUTSIDE the region. The scanner's existing iteration over _DJ_ACTIVITY_TAG_RE runs against the redacted source. Real uninstrumented {% dj_activity %} calls outside any verbatim block continue to fire A070 unchanged. Covered by 12 regression tests in python/tests/test_a070_verbatim_fp_1004.py (7 helper-contract tests + 5 scanner-integration tests including the canonical docs case, mixed verbatim + real calls, named verbatim form, and line number preservation).
  • djust.C011 now catches stale/placeholder output.css, not just totally-missing files (v0.7.3, #1003)_check_missing_compiled_css in python/djust/checks.py previously tested only os.path.exists(). A committed-but-stale output.css (e.g. a placeholder /* Run tailwindcss ... */) silently passed the check, the site rendered without any Tailwind utilities, and manage.py check emitted no warning. Reported by the docs.djust.org team after hitting it at launch — fresh-clone + make dev produced a broken page with zero warnings. Fix: new helper _output_css_looks_built(path) extends the contract to "the file exists AND looks built" — checks size > 10 KB AND a marker (tailwindcss banner OR @layer directive) in the first 512 bytes. The existing os.path.exists() branch is replaced with the helper. Both checks must pass; a 50 KB hand-rolled stylesheet without Tailwind markers is correctly flagged. Warning message updated from "output.css not found" to "output.css is missing or stale" with a hint that placeholder files are the canonical failure mode. Covered by 5 new regression tests (placeholder /* Run tailwindcss... */, empty 0-byte file, sub-10 KB file with banner, real built >10 KB Tailwind output, hand-rolled @layer stylesheet) plus 3 existing tests updated to use realistic Tailwind output (~16 KB minified-style fixture instead of the 18-byte placeholder that exposed the original bug).

All releases · Atom feed