Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #533 +/- ##
=========================================
Coverage 99.44% 99.45%
=========================================
Files 374 382 +8
Lines 27339 28726 +1387
Branches 3440 3677 +237
=========================================
+ Hits 27188 28570 +1382
- Misses 151 156 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
leftibot
force-pushed
the
cancelling-flags
branch
from
December 1, 2026 17:47
bbb4061 to
9ee4221
Compare
leftibot
force-pushed
the
cancelling-flags
branch
from
December 1, 2026 20:08
9ee4221 to
d527cb5
Compare
…make check tests
Autotools projects (jq, tmux, curl, libzmq) had no C build system, so their
warning flags and `make check` tests were missed, and every make command CI
ran was unknown ("the makefile: none is found where make runs"): configure
writes the makefile, so it is not in the checkout.
- configure.ac is evaluated without running m4 or the shell
(build_systems/autotools/configure_syntax.py, configure.py): macro calls
and shell statements, `if`/`case` branches, AS_IF, AS_CASE, AC_ARG_ENABLE,
AC_ARG_WITH, the flag macros (AX_CHECK_COMPILE_FLAG, AX_APPEND_COMPILE_FLAGS,
AX_APPEND_FLAG, gl_WARN_ADD) where the compiler accepts the flag, macros
the file defines, AC_SUBST and AM_CONDITIONAL. `test "x$GCC" = xyes` is
the GCC-like compilers; any other test is a requirement as written.
tmux's LTO probe, which sets -Werror for one compile check and restores
CFLAGS, leaves no -Werror.
- Each Makefile.am is read with the configure.ac above it (automake.py):
AM_CFLAGS, AM_CXXFLAGS, AM_CPPFLAGS and each built target's own flags,
through Automake conditionals, with configure's substitutions expanded.
- Autotools (Makefile.am) is a build system of C and C++; `make check`,
`distcheck` or `recheck` where a Makefile.am is (or in a build tree
outside the checkout) runs the tests TESTS and check_PROGRAMS name.
- Where no makefile is in the checkout but a Makefile.am is, make reads the
Makefile.am's rules, and Automake's own targets (policy/automake.toml) are
known, not unknown.
Part of cpp-best-practices#470
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ctices#470) Brackets around a shell test (an m4 quote, stripped), several assignments on a line, a case pattern on a line of its own, AS_IF and AS_CASE without their last branch, AC_SUBST with a value, unquoted arguments holding parentheses, a body-less AC_DEFUN, a stray else or fi, an assignment no build reaches, a configure.ac past the bound on conditions, and a Makefile.am variable set only where it is not used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
) Like configure.ac's most_defined_calls, how deep a Makefile.am reference is followed is a limit, not a constant in the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ystem (cpp-best-practices#470) The maintainer asked that the message read the same for every build system: "warnings are not treated as errors in CI configuration or the build files", rather than listing CMake files, presets and meson.build (leaving out configure.ac), or fpm's flags for Fortran. The hints, which say how in each build system, are unchanged, as is CMake's own presets finding. test_warnings_as_errors' SEARCHED and the bare_c, bare_cpp, bare_fortran and buildable snapshots change to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
leftibot
force-pushed
the
cancelling-flags
branch
from
December 1, 2026 22:23
d527cb5 to
d1d2de1
Compare
…pp-best-practices#470) Conditions are kept for the whole process, so a second reading of the same configure.ac builds no new nodes and never reaches the lowered bound. mutmut runs the suite more than once in one process, so the test failed in its clean run on cpp-best-practices#532 and cpp-best-practices#533. Each reading now gets names of its own, and the test reads twice to hold that in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
pybind11 defines its C++ tests only as executables of tests/ that custom targets run (`add_custom_target(cpptest COMMAND $<TARGET_FILE:test_with_catch>)`), and CI builds the targets; luanti builds its unit tests into the engine and CI runs `./bin/luanti --run-unittests`. CMake's add_executable and target_sources are now read: an executable with a source in a test directory, or named as a test (`test_ban.cpp`), is a test executable, unless CTest's tests already run it. A run of one, by a custom target's command or by CI naming the built file, runs its tests; one built with the product's sources too runs them only when an option asks for them (policy/tests.toml). Part of cpp-best-practices#482. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…t; a container may hold the project
pi-hole's CI runs `test/run.sh`, which picks its container runtime with
`if …; then RUNTIME="docker"; elif …; then RUNTIME="podman"; else exit 1; fi`,
cds into `"${SCRIPT_DIR}"`, and runs bats in a container of the image it
builds from the checkout: `"${RUNTIME}" run … bash -euo pipefail -c 'cd
/etc/.pihole/test; exec libs/bats/bin/bats "$@"'`. None of it was followed.
- facts/shell_values.py follows a script's syntax tree along every path
(if, case, loops, functions where they are called, nothing after exit)
and gives each command the values of the assignments that reach it; a
variable is known only when every one of them is. It replaces the
set-once constants: a command naming a variable of several values is a
command for each, up to policy/limits.toml's new `most_values`. A
function's body is followed where it is called, once per set of values,
four at most; `"$@"` is what the script file was run with, until a shift
(SwiftFormat's `./format.sh --lint`).
- Expanders that read none of the project's files (launchers, a shell's
command string, docker run) run in a directory the project does not
hold too, such as one a variable names.
- docker run's command runs in a container: it carries `container` in its
environment (as podman sets it), and an absolute `cd` there moves to the
container's own directory (IN_CONTAINER), not out of the project: a run
there covers the project heuristically, as one in a directory a variable
names does.
- `bash -euo pipefail -c '…'` is a command string: an option cluster that
ends in `o` takes the next word.
Part of cpp-best-practices#482.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
… code (cpp-best-practices#482) Tests: values put together past most_values (three systems by three architectures), nothing after exit, an array declared without a value, a function called again with the same values, one that always exits, and a local that leaves the caller's value as it was. _Analysis.value was never called; it is removed. A loop starts from a state, so what it holds is never None: join is split so that the loop uses `extended` (a state joined with a path that may have ended), and the check for None after its passes, which nothing could reach, is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…pp-best-practices#482) Beside most_values, the times a loop's body is followed and the sets of values a function's body is followed with are limits, not constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ease actions are read ast-grep's crates/wasm tests are `#[wasm_bindgen_test]` functions, which CI runs with `wasm-pack test --node` through `yarn test`: they now count as is an action no longer hide whether the tests run: PyO3/maturin-action runs `maturin build` with its args, katyo/publish-crates runs `cargo publish`, taiki-e/upload-rust-binary-action runs `cargo build --release`, and taiki-e/create-gh-release-action and heinrichreimer/action-github-changelog-generator release, running none of the project's code (policy/inert_actions.toml). Part of cpp-best-practices#482. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…st-practices#526) The maintainer: "tests run through another language should count. It's common for python fixtures to be used for C++." A unit with no tests of a language that builds a native module Python imports is tested by the Python tests that import the module, run as CI runs them: - A crate that depends on PyO3 builds the module its [lib] names (else its package, `-` as `_`): ast-grep's crates/pyo3, ast_grep_py, whose pytest tests now test its Rust. - CMake's pybind11_add_module(name ...) and nanobind_add_module build the C++ module `name`; when a variable the evaluation does not know names it, whether it has tests is unknown (an error, as ever). Python tests that import nothing of the module test nothing of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…-practices#484) A next step's hint is the first detail of its result that says what to do; 6020 of 27302 corpus next steps had none. Every result that does not pass now gives its advice in a detail: no tests (which to add, and how CI runs them), no coverage, no lints (the profile's words, else the settings to enable), no CI, a matrix short of its minimum, files that do not parse, undeclared schemas, a licence mismatch, a limit that is off, an unknown answer (pass --allow-unknown). A test holds every fixture's next steps to a hint. The run then fits the advice to the project (project_validator/hints.py, by policy/hints.toml): a placeholder for a file the project chooses (`<your .asd file>`, `<your .tex document>`, `<your root .zig file>`) is the project's one file that fits, never an invented main.tex or shop.asd; a setting for a build system it does not use, `(CMake: …; Meson: …)`, is left out; an Eldev project is advised in Eldev rather than Eask. The local rocks tree is asked for only in a rock (a project with a rockspec). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
Every practice's wording gives its own hint, so a settings practice never fell back to "enable ..." or "remove ...", and nothing asked hints for its placeholders: both were dead code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ctices#487) A next step asked a project to add what it already does: - google/gson's maven-compiler-plugin `<failOnWarning>true</failOnWarning>` now treats warnings as errors (maven-dependency-plugin's does not). - `flutter analyze` makes infos and warnings fatal by default, unless given `--no-fatal-infos` or `--no-fatal-warnings` (flutter_expandable_table). - A licence a root manifest declares, with no license file, warns naming the manifest rather than failing: R's `License:` in DESCRIPTION (ropensci/skimr, R's names read as SPDX) and `licenses:` in mix.exs are now read, beside package.json, Cargo.toml, pyproject.toml and the others. - Where CI calls remote workflows or actions the validator did not read, an unknown answer's first advice is to read them with --fetch-remote, not to add what they may already run (charmbracelet/bubbletea). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
`lizard --length 100000`, RuboCop's `Metrics/MethodLength Max: 100000` and SwiftLint's `function_body_length: 100000` earned function-limits; `coverage report --fail-under=0`, `cargo llvm-cov --fail-under-lines 0` and Vitest thresholds turned off earned the gated coverage rung. - policy/thresholds.toml: a function length limit of 1000 lines or more is none (lizard's own default, which its code already called no limit); a coverage floor at or below 0 fails no run. - facts.limits: a Rule says why its settings let every function through (`unlimited(tool, limits)`, which knows each rule's defaults: funlen's 60 lines and 40 statements, clang-tidy's 800 statements); lizard reads its own limits. Such a limiter's run is advisory, so function-limits says "X runs in CI but cannot fail it (its limit lets every function through: --length 100000)". RuboCop, SwiftLint, detekt, golangci-lint's funlen and clang-tidy's readability-function-size; Checkstyle's max, PHPMD's and eslint's limits are not read. - facts.coverage: `floors`, `thresholds` and `gated_by` read the thresholds coverage.py, pytest-cov, gcovr, lcov, cargo-llvm-cov and c8/nyc are given; Vitest's 0 or `100: false` thresholds do not gate. A run given only such a floor is reported, not gated, and keeps why (Run.ungated, ToolRun.ungated); the coverage result names it: "gcovr's threshold fails no run (--fail-under-branch=0): in place but not enforced". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ractices#477) `.prettierignore` holding `*`, `ruff --exclude '*.py'`, RuboCop's `AllCops: Exclude: ['**/*']`, JuliaFormatter's `ignore = ["*"]` and a jscpd `ignore` of `**/*` left the tool no file; `.ocamlformat`'s `disable = true`, golangci-lint's `linters: default: none`, SwiftLint's `only_rules: []`, `cppcheck --suppress='*'` and a `.luarc.json` with diagnostics off turned every rule off. Each was credited as the tool. - A run whose exclusions (its settings', its command's, or what runs it selects) leave it no file of its languages in its scope is an InertRun naming them: "prettier runs in CI but checks nothing (its settings leave it no file to check: .prettierignore anywhere: *)". Scoping.options reads exclusions on the command line (ruff's --exclude, --extend-exclude); new Scopings for .prettierignore, RuboCop's AllCops.Exclude and JuliaFormatter's ignore. - tools/ignore_files.py: the .gitignore-style ignore files share one reader (ESLint's .eslintignore moves there, unchanged). - facts.tools.unless_off / setting_off: a claim whose settings turn the tool off is inert (ocamlformat, lua-language-server, SwiftLint), and golangci-lint with its defaults off and no linter enabled. - Where the tool's own settings are why (facts.tools.by_settings), the result's message says "CI runs RuboCop, but its settings leave it nothing to check", not "RuboCop is configured but does not run". - cppcheck --suppress=* is an inert option (inert_commands.toml). - copy-paste-detection reads .jscpd.json; judging.Advised can carry inert tools, so the result says jscpd checks nothing. - .JuliaFormatter.toml, .ocamlformat and .luarc.json are now read for their settings, not only found. - A settings pattern that is its file's own folder (tsconfig's `"include": ["."]`) matches all of it; it matched nothing, which the corpus showed once such a run became inert (ast-grep). - tests/support.py: checked_with_steps, facts_with_steps (a project whose one GitHub job runs some steps) and said, used by the cpp-best-practices#477 tests, which had each copied them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
`cargo clippy -- -D warnings -A warnings` earned warnings-as-errors and `-W clippy::pedantic -A clippy::pedantic` earned clippy::pedantic, though clippy reads the last level a lint is given. - facts.tools.undone: the words of a command that set what a later word sets otherwise, and why, by policy/inert_commands.toml's `later_flag_wins`: lint levels for clippy (-A/-W/-D, --allow/--warn/ --deny, also after `--` and as `-Dwarnings`), and dart/flutter analyze's --fatal-infos/--no-fatal-infos and --fatal-warnings pairs. - ci_texts leaves the undone words out; advisory_texts holds the whole command, and practices.not_enforced gives why, so the requirement only the undone flag meets is "in place but not enforced": "-D warnings runs in CI but cannot fail it (-A warnings, later on its line, undoes -D warnings)". `dart analyze --no-fatal-infos --fatal-infos` stays fatal. - Rust's clippy::pedantic requirement no longer matches `-A clippy::pedantic`, which allows the lints. - MSBuild's RunAnalyzers or EnableNETAnalyzers false, or AnalysisMode None (inert_commands.toml `msbuild_analyzers_off`), in every C# project or a Directory.Build.props above it, make the analyzer runs inert by settings: "CI runs Roslynator, but its settings leave it nothing to check". NoWarn lists stay per rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
leftibot
force-pushed
the
cancelling-flags
branch
from
December 2, 2026 01:51
d1d2de1 to
2f3f2ec
Compare
Conditions are kept for the whole process. When the unbounded curl loop test runs first, as in mutmut's clean run, which orders tests by duration, the bounded reading builds no new nodes and never reaches the lowered bound, so mutmut failed on cpp-best-practices#533. The bounded reading now gets fresh CURL_USE_ names, and the test first reads the plain fixture to hold that in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last of four stacked PRs for #477: a later flag that undoes an earlier one wins, as the tool reads it.
What it detects
cargo clippy -- -D warnings -A warnings(rhai)cargo clippy -- -W clippy::pedantic -A clippy::pedantic(ast-grep)flutter analyze --no-fatal-infos --fatal-infos(flutter_expandable_table)--fatal-infoswinsdart analyze --fatal-infos --no-fatal-infosHow
facts.tools.undone(command)finds the words that set something a later word sets otherwise, and says why. The pairs per tool are a newlater_flag_winstable inpolicy/inert_commands.toml:levels: options that take a value and set its level, such as clippy's-A/-W/-Dand the long forms. These are read after--too, and when written together (-Dwarnings).flags: switches that set a state, such as dart/flutter analyze's--fatal-infos/--no-fatal-infosand--fatal-warnings/--no-fatal-warnings.|| true) is "not enforced" for some checks but full credit for others #479 mechanism carries the result:ci_textsleaves the undone words out.advisory_textsholds the whole command.practices.not_enforcedgives the reason, also foradvisedandadvised_names.clippy::pedanticrequirement no longer matches-A clippy::pedantic(or--allow), which allows the pedantic lints. Before, writing it anywhere counted as turning them on.Corpus before → after (the whole stack)
Corpus, real projects. I ran
cmp.shon the 18 issue projects in the corpus cache, comparing main with the top of the stack. None of them hold these settings: the reviewers made the moves in scratch copies. 17 of the 18 are unchanged. ast-grep goes from 123 to 124 of 193 gates. That comes from #532's tsconfig"include": ["."]fix:crates/napi's TypeScript was "no run reaches", and is now reached.Corpus, the issue's moves. I redid each move in a scratch copy, and compared main with the top of the stack:
phpunit --filter NoSuchTest --path-coveragego test -run '^$'./mvnw test -DskipTestsdotnet test --filter NoSuchTestlizard --length 100000AllCops: Exclude: ['**/*']+Max: 100000only_rules: []+function_body_length: 100000--fail-under=0+ruff --exclude '*.py'--fail-under-lines 0,-W clippy::pedantic -A clippy::pedantic.prettierignore*ignore = ["*"].ocamlformatdisable = truelinters: default: nonecppcheck --suppress='*'.luarc.jsondiagnostics offcargo clippy -- -D warnings -A warnings,cargo test no_such_test_anywhere--fatal-infos --no-fatal-infosMSBuild analyzers turned off (the maintainer's call)
<RunAnalyzers>false</RunAnalyzers>,<EnableNETAnalyzers>false</EnableNETAnalyzers>or<AnalysisMode>None</AnalysisMode>turns every analyzer off when it is in every C# project, or in aDirectory.Build.propsabove it. The properties are ininert_commands.toml'smsbuild_analyzers_off. The analyzer packages' runs (Roslynator, SonarAnalyzer, StyleCop, Meziantou) and the .NET security analyzers become inert by settings: "CI runs Roslynator, but its settings leave it nothing to check". ANoWarnlist stays per rule. If one project still runs analyzers, they still count.Still left of #477
<AnalysisMode>All</AnalysisMode>beside<RunAnalyzers>false</RunAnalyzers>(satrapu's shape). Practices have no "not enforced" path for a requirement met in settings files.disabled_rulesnaming every rule: the validator holds no list of SwiftLint's rules.only_rules: []is caught.--exit-code 0was already caught on main; "unrelated image" is not judged.max, PHPMDminimumand eslintmax-lines-per-function.Part of #477.
Tests
New:
tests/test_cancelling_flags.py. Each case uses the issue's input, beside the same run without the undoing flag; it also checks that the later flag wins in both orders, and that flags on different lints don't cancel. No existing test or snapshot changed.Gates
All pass:
ruff,ruff format,mypy,lizard, unit tests with coverage (99%),jscpd,markdownlintand the strict self-check, fromgates2.sh.Rebase note:
facts/tools.pyalready has a_givenhelper from #516, so this PR's helper is renamed_settings_given. The duplicate silently replaced #516's helper, and neither ruff nor mypy flags that.Test fix (later commit):
test_builds_too_complex_to_follow_are_not_known_and_noted(from #517) now gives the bounded reading freshCURL_USE_names. Conditions are kept for the whole process, so when the unbounded curl-loop test ran first, as in mutmut's clean run, the bounded reading built nothing new and never reached the bound. That was this PR's mutmut failure. The same flaw in the autotools test was fixed in #522.🤖 Generated with Claude Code
https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt