Repository navigation
Detection: auxiliary-only languages, nested packages as units, test-project credit by dependency - #372
Merged
Conversation
…ts/, *_bench, *_example Part of cpp-best-practices#182 and cpp-best-practices#188. Names the corpus uses for auxiliary code besides the plain ones: Kubernetes' `hack/` and Dart's `tool/` maintainer scripts (tooling), rust-lang/book's `listings/` (example), koyo's `blueprints/` (template), Flutter's and phoenix's `integration_test/` (test), and a directory whose first or last word tells its role: dart-lang/http's `flutter_http_example`, fpm's `example_packages`, ruff's `ruff_benchmark`, `tests-build`. A last word `test` does not tell: a library for testing is a product (bloc's `bloc_test`), and Racket's `foo-test` packages are told by what their info.rkt says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
Part of cpp-best-practices#182. A language whose every source is test, example, docs, tooling or benchmark code (a test fixture in C, a docs theme's script, a maintainer's script under hack/), that no build file outside auxiliary code builds and whose ecosystem has no product language (a Java project's tests in Kotlin stay its own), is judged as if --auxiliary named its role: labelled "(auxiliary: only in test code)", failures are warnings, and it weighs half in the score. A project with no product language left is judged as it is. An auxiliary unit's result says it is auxiliary once. The expected-failure regression test for cpp-best-practices#182 now passes. Tests that pinned the old default (a C++ project's lone Python release script judged as the product) now pin the new one, and that a language with product code is still the product's in its helper scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…or product-only gates Part of cpp-best-practices#188 and cpp-best-practices#230. A build file below another of its build system's is a project of its own where the build system says so (`BuildSystem.standalone`): a nested Package.swift, mix.exs, Cargo.toml (a package or workspace), package.json with a name, pubspec, fpm.toml, dbt_project.yml, composer.json, pyproject.toml, go.mod, .cabal, Gemfile, deps.edn or project.clj. It becomes a unit with the role its directory tells: vapor's Benchmarks/, phoenix's installer/ and integration_test/, dbt-utils' integration_tests/. A CMake subdirectory, a Maven module, LuaRocks' rockspecs/, a package.json that only marks its directory's modules and a test fixture's manifest stay part of the unit above them. A unit the map names auxiliary (a cargo-fuzz crate, a benchmark package) is not judged for the gates of the product alone (NOT_FOR_AUXILIARY, now shared by the score and the checks), nor asked for tests it does not have (tests-run judges one that has tests). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
… a unit Part of cpp-best-practices#188. pnpm declares its workspace in pnpm-workspace.yaml, not package.json (graphql-eslint, graphql-inspector). The npm build system now reads it as it reads package.json's `workspaces`, so a member is a unit of its own whether or not its package.json has a name, with the role its directory tells (`examples/*`). The command-scoping reader of the same file now shares its parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
Part of cpp-best-practices#188. pnpm, yarn and bun run the binary of a name that is no script of the package: `yarn c8 yarn test` is `yarn exec c8 yarn test`. That command was dropped, so prettier's coverage job (`yarn c8 yarn test`) was never seen to run c8; its c8 credit came only from a nested tooling package's script, folded into the root until that package became a unit of its own. The command now launches the binary it names, and its own `yarn test` runs the package's test script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…ling Part of cpp-best-practices#188. Found in the corpus once nested packages became units: - A template unit (fluentd's templates/new_gem, the gem its plugin generator writes) is not the product's: it counts with the auxiliary units, so it is not asked for tests or the product's gates. - dependency-management is a gate of the product alone: a benchmark app or a test project that locks nothing (puma's benchmarks/local/sinatra, tokio's tests-integration) no longer warns. - `vendor-bin/` holds the tools bamarni/composer-bin-plugin installs (guzzle): tooling, not product units without tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
Part of cpp-best-practices#230. A unit of tests (a separate test project) counted, and its CI runs counted, for every unit of the project: tokio's tests-integration lent its 9 test files to benches/, examples/ and stress-test/, and hledger-web/test/browser's Playwright specs to the root package. A unit of tests now tests the units its build files depend on by path (Cargo's `path = "../tokio"`, package.json's `file:../x`: the new `BuildSystem.path_dependencies`) and the unit it is in, but for the root (`Unit.tests`); one that says neither still tests every unit (serde's test_suite, .NET's and OCaml's test projects). One predicate, `tests_unit`, now answers it for both the test files and the test runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
…oduct's Part of cpp-best-practices#188. A manifest or a tool's configuration below a test suite's data directory (`tests/fixtures/`, `tests/**/Fixtures/`, `testdata/`) is test data, set apart from the code around it as code --auxiliary names is (`Selectors.apart`): PHP_CodeSniffer's fixture phpcs.xml.dist files no longer define its formatting, nor composer's and poetry's fixture manifests and lock files its dependencies. An example's files are not set apart: a Flutter plugin's tests are its example app's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #372 +/- ##
==========================================
- Coverage 99.70% 99.69% -0.02%
==========================================
Files 313 313
Lines 20155 20273 +118
Branches 2376 2388 +12
==========================================
+ Hits 20096 20211 +115
- Misses 59 62 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 24, 2026
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.
Detection fixes for the
area: detectionissues: auxiliary-only languages, nested packages, test-project credit. Part of #182, #188 and #230. #186 is left out, as decided.Decisions this follows
(auxiliary: only in test code). Auxiliary code here means test, example, docs, tooling or benchmark code. That code is still judged and scored, at half weight like--auxiliary, but its failures are warnings.Commits
Each commit is test-first and references its issue.
Role names (A language present only in auxiliary files (fixtures, tooling, docs assets, editor dotfiles) becomes a product ecosystem and its FAILs decide the project #182, Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188). New directory names now tell a role:
hack/,tool/,vendor-bin/(tooling),listings/(example),blueprints/(template) andintegration_test/(test). So do directory names whose first or last word is a role, such asruff_benchmark,flutter_http_exampleandexample_packages. A finaltestalone does not count, because bloc'sbloc_testis a library for testing.Auxiliary by default (A language present only in auxiliary files (fixtures, tooling, docs assets, editor dotfiles) becomes a product ecosystem and its FAILs decide the project #182). A language counts as auxiliary when all of these hold:
It is then judged as if
--auxiliaryhad named its role. This settles Deferred from the bug-fix rounds: policy decisions and design work #324's A language present only in auxiliary files (fixtures, tooling, docs assets, editor dotfiles) becomes a product ecosystem and its FAILs decide the project #182 item, and A language present only in auxiliary files (fixtures, tooling, docs assets, editor dotfiles) becomes a product ecosystem and its FAILs decide the project #182's expected-failure regression test now passes.Nested packages are units (Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188, Test files and formats are attributed to the whole tree or the root unit, not to the unit that owns them #230). A new hook,
BuildSystem.standalone, says whether a nested build file is a project of its own:Benchmarks/, phoenix'sinstaller/andintegration_test/, and dbt-utils'integration_tests/.rockspecs/,{"type": "module"}marker files and test fixtures.Auxiliary units are not judged for the product-only gates (
NOT_FOR_AUXILIARY, now shared by the score and the checks). tests-run judges such a unit only when it has tests of its own.pnpm workspaces (Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188).
pnpm-workspace.yamlis read as a workspace declaration, sharing its parser with command scoping.yarn c8 yarn test(Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188). A package-manager command naming no script now runs the binary of that name. prettier's coverage job had never been seen to run c8. Its only c8 credit came from a nested package that is now a unit of its own.Corpus follow-ups (Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188):
templates/new_gem);vendor-bin/is tooling (guzzle).Test-project credit (Test files and formats are attributed to the whole tree or the root unit, not to the unit that owns them #230). A unit of tests tests the units it depends on by path, plus the unit it sits inside, unless that is the root. Path dependencies come from Cargo's
path =and package.json'sfile:, through a new hook,BuildSystem.path_dependencies. A unit of tests that says neither still tests every unit, as before. One predicate,tests_unit, now serves both test-file credit and run credit.Fixture configuration (Nested manifests are folded into the root product unit or judged as products: benchmark/example/test/template/docs sub-projects #188). Manifests and tool configuration under
tests/fixtures/,Fixtures/ortestdata/are no longer named as the product's. Examples are PHP_CodeSniffer's fixturephpcs.xml.distfiles and composer's and poetry's fixture manifests.Corpus (235 projects, main → this branch)
127 projects differ. 151 check results go from FAIL to WARN (or SKIP); most are a fixture, docs script or maintainer script in a language the product doesn't use. Five get worse. Each comes from per-unit judgement now that borrowed credit stops:
packages/rule-testerandpackages/cli, are now judged one by one.serde_derive_internalsis no longer credited withtest_suite's tests.test_suitedoesn't depend on it; it shares source withserde_derivethrough a symlink.globset, so the root and the other crates now report no fuzz targets.Also changed:
Gemfileis now a unit without a gemspec, so the validator asks for a lock file.tools/.mjsscript. Ignore rules in the docs site don't count for auxiliary tooling code. That rule already applied with--auxiliary.Left open
tests/data/jupyter/*.ipynbstill fail tests-run.examples/perlcriticrc), because a Flutter plugin's tests live in its example app;external/, koyo's migration counting, and json-fortran'svisual_studio/.ProjectReferenceisn't read, because a solution's projects are not units of their own yet.🤖 Generated with Claude Code
https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt