Repository navigation
v1.9.0
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) andbes-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 bringslxml >= 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: localwithlanguage: python, add"validate_bes_xml>=2.2.1"toadditional_dependencies.
Added
-
bes-relevance-convert-group, a new hook. It rewrites each/BES/*/GroupRelevance(in a Fixlet, Task, Baseline, Analysis or FixletStream) in place:JoinByIntersectioncomponents becomes trueany one <Relevance>per componentfalseone <Relevance>s1</Relevance>falsetwo 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.
--checkis a dry run. - A missing
JoinByIntersectionstill converts when there is only one component. With two or more components it isE702, because BES.xsd documents no default. SearchComponentGroupReference(group membership) is not converted yet. Those files are reported asE701and left unchanged.- Codes:
E700converted / needs converting,E701group reference,E702bad or missingJoinByIntersection,E703no components or an empty Relevance,E704the result would fail BES.xsd,W700skipped. - A file opts out with
<!-- pre-commit-skip: bes-relevance-convert-group -->. - Enable it with
- id: bes-relevance-convert-groupunder this repo'shooks:.
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
E401are kept even when an unrelated fix is held back.- In
bes-conventions-check, all the per-block fixes form one pass. Inbes-actionscript-lint-schclassall 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-validatereports it either way. - Only the schemas bundled with
validate_bes_xmlare used, so a repo-local.xsdcannot stand in forBES.xsd. An.ojofile is checked againstBESOJO.xsdand a.BESDomainfile againstBESDomain.xsd.
- In
- Shared helpers moved into
pre_commit_bigfix/bes_common.py. These are file reading and writing with line-ending preservation,.besdiscovery, the report printer and the mustache-template pattern. Hooks behave the same as before.
Full Changelog: v1.8.4...v1.9.0