Crossweft / Updates / v0.2.7
UPDATE · v0.2.7 ·

Hazard rules for script lines that fail without an error

Opt-in rules catch script lines that run cleanly yet break what another program reads, such as a lost redirect value or a missing status read as 0.

Some seams break inside a single script line. The line runs without an error, and the program reading its output gets the wrong thing. This release adds built-in rules for four such cases. They are off until you list files for them in crossweft.json:

"hazards": {"include": ["scripts/**/*.cmd", "tools/**/*.ps1"]}
  • cmd-digit-redirect: in echo x=%V%>>file, a one-digit value is taken as a stream handle and lost.
  • empty-to-zero: [int]$parts[1] or int(x or 0) turn a missing status into 0.
  • toolchain-env-name: flags set RC=%ERRORLEVEL% before cmake, cl, msbuild or make.
  • glob-length-guard: a case reject branch like ??..?* also refuses input of exactly N characters.

A hit is reported as a hazards problem and can be excused by a finding like any other. An include glob that matches no file is a fatal error, so a typo cannot switch the rules off. crossweft self-test runs planted unsafe and safe examples for each rule.

Source: v0.2.7 · CHANGELOG.md

← v0.2.5, v0.2.6v0.2.8 →