Skip to content

v1.9.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 17:16
· 18 commits to main since this release
3ca4620

This release adds a new hook, bes-relevance-convert-group, which rewrites a console-exported <GroupRelevance> into plain <Relevance>. It also adds a BES.xsd check to every hook that auto-fixes BES files. A fix that would make a schema-valid file invalid is no longer written.

⚠️ Upgrade notes

  • Auto-fixing hooks can now fail with a new error where they used to fix and pass. This affects bes-conventions-check (E222), bes-actionscript-lint-schclass (E304), bes-actionscript-validate-prefetch (E404) and bes-actionscript-validate-script (E526). Each code means a fix pass was held back because it would have broken BES.xsd validity. Disabling the code (for example --disable E222) writes the fix anyway.
  • Requires validate_bes_xml >= 2.2.1 (which brings lxml >= 5). The published hooks install it. If you run a hook script outside its hook environment and this package is missing, fixes are written unchecked, and a one-line warning on stderr says to install it.
  • If you define these hooks as repo: local with language: python, add "validate_bes_xml>=2.2.1" to additional_dependencies.

Added

  • bes-relevance-convert-group, a new hook. It rewrites each /BES/*/GroupRelevance (in a Fixlet, Task, Baseline, Analysis or FixletStream) in place:

    JoinByIntersection components becomes
    true any one <Relevance> per component
    false one <Relevance>s1</Relevance>
    false two or more <Relevance>(s1) OR (s2) OR ...</Relevance>
    • Each component's relevance is copied verbatim, and CDATA stays CDATA. An OR-join of several components is written once, as CDATA when any input was CDATA or the text needs escaping.
    • Everything outside the replaced block stays byte-identical, line endings included.
    • The hook converts by default and exits 1 when it changed something, so you can review the rewrite. --check is a dry run.
    • A missing JoinByIntersection still converts when there is only one component. With two or more components it is E702, because BES.xsd documents no default.
    • SearchComponentGroupReference (group membership) is not converted yet. Those files are reported as E701 and left unchanged.
    • Codes: E700 converted / needs converting, E701 group reference, E702 bad or missing JoinByIntersection, E703 no components or an empty Relevance, E704 the result would fail BES.xsd, W700 skipped.
    • A file opts out with <!-- pre-commit-skip: bes-relevance-convert-group -->.
    • Enable it with - id: bes-relevance-convert-group under this repo's hooks:.

Changed

  • Every BES auto-fix write is checked against BES.xsd, one fix pass at a time. A pass that would turn a schema-valid file invalid is not written, and the other passes still are. For example, sha256 values downloaded for E401 are kept even when an unrelated fix is held back.
    • In bes-conventions-check, all the per-block fixes form one pass. In bes-actionscript-lint-schclass all the case fixes form one pass. In both, one bad fix holds back the rest of its pass.
    • A file that already fails validation is still fixed, since bes-schema-validate reports it either way.
    • Only the schemas bundled with validate_bes_xml are used, so a repo-local .xsd cannot stand in for BES.xsd. An .ojo file is checked against BESOJO.xsd and a .BESDomain file against BESDomain.xsd.
  • Shared helpers moved into pre_commit_bigfix/bes_common.py. These are file reading and writing with line-ending preservation, .bes discovery, the report printer and the mustache-template pattern. Hooks behave the same as before.

Full Changelog: v1.8.4...v1.9.0