Skip to content

feat(cargo-anvil): split managed lint regions - #191

Open
martin-kolinek wants to merge 7 commits into
mainfrom
feat/anvil-empty-struct-lint
Open

martin-kolinek wants to merge 7 commits into
mainfrom
feat/anvil-empty-struct-lint

Conversation

@martin-kolinek

@martin-kolinek martin-kolinek commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

🤖 Splits Cargo lint management into separate Rust, rustdoc, and Clippy regions backed by explicit [workspace.lints.<namespace>] / [lints.<namespace>] tables.

  • keeps each namespace stable under cargo sort --grouped
  • lets adopters add repository-specific bare lint keys after the corresponding closing sentinel
  • migrates legacy combined regions and hand-written dotted lint assignments without changing their namespace
  • adds coverage for workspace and single-crate migration, repository residue, profile-table preservation, and second-run idempotence
  • adds empty_structs_with_brackets = "warn" and the catalog-level literal_string_with_formatting_args = "allow" override
  • removes the redundant explicit too_long_first_doc_paragraph entry because the catalog's nursery = "warn" group already enables it
  • releases cargo-anvil 0.12.0 with script-generated changelog and metadata

Oxidizer PR microsoft/oxidizer#769 adopts this layout while preserving its local missing_docs, unreachable_pub, and clippy::panic policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The TOML-adoption snapshot still omits the newly generated lint entry.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Moves clippy::empty_structs_with_brackets into cargo-anvil’s managed lint catalog and synchronizes documentation, tests, generated outputs, and checksums.

Changes:

  • Added the lint to the catalog and root workspace policy.
  • Updated catalog documentation and invariant tests.
  • Refreshed backend snapshots and .anvil.lock.
File summaries
File Description
Cargo.toml Adds the lint to the managed workspace catalog.
crates/cargo-anvil/templates/regions/cargo-lints-body.toml Defines the generated catalog entry.
crates/cargo-anvil/src/anvil/artifacts/region.rs Updates catalog tests and exclusions.
crates/cargo-anvil/docs/design/README.md Documents catalog policy.
crates/cargo-anvil/tests/snapshots/*.snap Updates emitted backend snapshots.
.anvil.lock Updates catalog and region checksums.
Review details
  • Files reviewed: 7/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/cargo-anvil/templates/regions/cargo-lints-body.toml Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 18, 2026 14:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The workspace policy drops clippy.too_long_first_doc_paragraph without preserving or documenting that behavior change.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread Cargo.toml Outdated
Copilot AI review requested due to automatic review settings September 18, 2026 14:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The root workspace policy drops clippy.too_long_first_doc_paragraph without documenting or replacing that behavior.

Review details

Suppressed comments (1)

Cargo.toml:185

  • This hunk also removes clippy.too_long_first_doc_paragraph from the root [workspace.lints] policy: the deleted block was its only occurrence, and the updated template/catalog has no replacement (the repository now has no matches). That changes every workspace crate's lint policy even though this PR is described as adding empty_structs_with_brackets; please retain the existing entry outside the managed region or add it to the catalog, or document the intentional policy removal.
clippy.empty_structs_with_brackets = "warn"
  • Files reviewed: 8/9 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 18, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The catalog, generated outputs, documentation, tests, snapshots, and checksums are synchronized with no unresolved issues found.

Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.94313% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.5%. Comparing base (1910173) to head (642aad0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/cargo-anvil/src/region.rs 88.3% 17 Missing ⚠️

❌ Your project status has failed because the head coverage (97.5%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #191     +/-   ##
=======================================
- Coverage   97.6%   97.5%   -0.1%     
=======================================
  Files        304     304             
  Lines      69683   69869    +186     
=======================================
+ Hits       68016   68189    +173     
- Misses      1667    1680     +13     
Flag Coverage Δ
linux 97.5% <91.9%> (-0.1%) ⬇️
linux-arm 97.5% <91.9%> (-0.1%) ⬇️
scheduled ?
windows 97.7% <91.9%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

martin-kolinek and others added 2 commits September 18, 2026 19:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@martin-kolinek martin-kolinek changed the title feat(cargo-anvil): lint empty braced structs feat(cargo-anvil): split managed lint regions Sep 18, 2026
Copilot AI review requested due to automatic review settings September 18, 2026 17:33
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The migration drops an existing lint policy, and generated lock provenance still reports version 0.11.0.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

Cargo.toml:209

  • The previous repository-owned clippy.too_long_first_doc_paragraph = "warn" policy is removed from this manifest, but it is neither in the new cargo-clippy-lints.toml catalog nor preserved as a bare key after this sentinel. That silently drops an existing lint policy during the split; keep it as a repository-specific bare assignment after the Clippy region (or explicitly retain it in another supported policy surface).
# <<< anvil-managed: anvil-workspace-clippy-lints
  • Files reviewed: 23/25 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .anvil.lock Outdated
Copilot AI review requested due to automatic review settings September 18, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Documentation still overstates legacy-region retirement and references the deleted combined lint template.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

crates/cargo-anvil/templates/regions/cargo-lints-body.toml:1

  • Removing this template leaves stale references to its path in the surviving source and generated comments: templates/regions/clippy.toml:26-27 and templates/justfiles/anvil/checks/miri-tree-borrows.just:14-15 (also the checked-in copies). Update those references to the split catalog/template before deleting this file, otherwise emitted guidance points at a nonexistent cargo-lints-body.toml.
    crates/cargo-anvil/docs/design/updates.md:176
  • This migration is not unconditional: ComposedHosts::retiring_regions only treats a recorded, unchanged (or empty) legacy region as retiring (src/run.rs:770-798), while an edited legacy region is kept and refused (src/run.rs:1093-1104). Please qualify this paragraph so the design contract does not promise retirement for customized old blocks.
  • Files reviewed: 23/25 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions

Copy link
Copy Markdown

⚠️ SemVer check advisory

Inconclusive comparisons

cargo semver-checks could not complete the following comparisons. These failures are informational because an unbuildable baseline is not evidence of a breaking API change.

cargo-aprz-lib (exit 101)

     Cloning 2dfdaab10f6f66c92aeacb7d6527ace3b4f15b2c
    Building cargo-aprz-lib v1.1.2 (current)
error: running cargo-doc on crate 'cargo-aprz-lib' failed with output:
-----
   Compiling proc-macro2 v1.0.107
   Compiling unicode-ident v1.0.26
   Compiling quote v1.0.47
   Compiling libc v0.2.189
    Checking memchr v2.8.3
    Checking cfg-if v1.0.5
    Checking smallvec v1.16.1
    Checking bytes v1.12.1
    Checking regex-syntax v0.8.11
    Checking once_cell v1.21.4
   Compiling thiserror v2.0.20
   Compiling syn v3.0.6
    Checking stable_deref_trait v1.2.1
   Compiling crc32fast v1.5.2
    Checking scopeguard v1.2.0
   Compiling crossbeam-utils v0.8.23
    Checking regex-automata v0.4.18
    Checking zlib-rs v0.6.8
   Compiling parking_lot_core v0.9.12
   Compiling getrandom v0.4.3
    Checking bitflags v2.13.2
    Checking fastrand v2.5.0
    Checking gix-trace v0.1.21
    Checking lock_api v0.4.14
   Compiling serde_core v1.0.229
    Checking tinyvec v1.13.3
    Checking bstr v1.13.1
    Checking parking_lot v0.12.5
    Checking itoa v1.0.18
    Checking unicode-normalization v0.1.25
    Checking gix-validate v0.11.4
    Checking gix-utils v0.3.6
    Checking crossbeam-channel v0.5.17
    Checking same-file v1.0.6
    Checking walkdir v2.5.0
    Checking allocator-api2 v0.2.21
   Compiling shlex v2.0.1
    Checking equivalent v1.0.2
    Checking byteorder v1.5.0
   Compiling find-msvc-tools v0.1.13
    Checking foldhash v0.2.0
    Checking prodash v31.0.0
   Compiling jobserver v0.1.35
   Compiling cc v1.4.7
    Checking gix-error v0.2.5
   Compiling pkg-config v0.3.34
   Compiling version_check v0.9.5
   Compiling generic-array v0.14.7
    Checking hashbrown v0.17.1
    Checking typenum v1.20.1
   Compiling thiserror-impl v2.0.20
   Compiling heapless v0.8.0
    Checking hash32 v0.3.1
    Checking faster-hex v0.10.0
    Checking cpufeatures v0.2.17
   Compiling serde v1.0.229
   Compiling serde_derive v1.0.229
    Checking crypto-common v0.1.7
    Checking block-buffer v0.10.4
    Checking jiff-core v0.1.1
    Checking digest v0.10.7
    Checking sha1 v0.10.7
    Checking pin-project-lite v0.2.17
    Checking sha1-checked v0.10.0
    Checking gix-path v0.12.6
   Compiling synstructure v0.14.0
    Checking gix-features v0.48.1
   Compiling rustix v1.1.5
    Checking jiff v0.2.37
    Checking gix-hash v0.25.1
    Checking linux-raw-sys v0.12.1
   Compiling zerofrom-derive v0.1.8
    Checking zerofrom v0.1.8
   Compiling yoke-derive v0.8.3
    Checking gix-date v0.15.6
   Compiling autocfg v1.5.1
    Checking gix-actor v0.41.2
    Checking gix-hashtable v0.15.2
    Checking futures-core v0.3.34
    Checking gix-object v0.61.0
   Compiling zerovec-derive v0.11.6
    Checking errno v0.3.14
    Checking yoke v0.8.3
    Checking signal-hook-registry v1.4.8
   Compiling displaydoc v0.2.7
   Compiling tokio-macros v2.7.2
    Checking socket2 v0.6.5
    Checking memmap2 v0.9.11
    Checking mio v1.2.3
   Compiling cmake v0.1.58
   Compiling rustversion v1.0.23
    Checking zerovec v0.11.8
    Checking tokio v1.53.1
   Compiling dunce v1.0.5
   Compiling fs_extra v1.3.0
    Checking futures-sink v0.3.34
   Compiling aws-lc-sys v0.45.0
    Checking tinystr v0.8.4
    Checking tempfile v3.27.0
    Checking gix-fs v0.21.2
    Checking gix-chunk v0.7.3
   Compiling vcpkg v0.2.15
    Checking litemap v0.8.3
    Checking writeable v0.6.4
    Checking percent-encoding v2.3.2
    Checking icu_locale_core v2.3.0
   Compiling libz-sys v1.1.29
    Checking gix-tempfile v23.0.2
    Checking potential_utf v0.1.6
    Checking zerotrie v0.2.5
    Checking gix-quote v0.7.2
    Checking tracing-core v0.1.36
   Compiling icu_properties_data v2.3.0
    Checking zeroize v1.9.0
    Checking utf8_iter v1.0.4
    Checking nonempty v0.12.0
    Checking slab v0.4.12
   Compiling aws-lc-rs v1.18.1
    Checking simd-adler32 v0.3.10
   Compiling icu_normalizer_data v2.3.0
    Checking icu_collections v2.3.0
    Checking tracing v0.1.44
    Checking icu_provider v2.3.1
    Checking http v1.5.0
    Checking fnv v1.0.7
    Checking adler2 v2.0.1
    Checking miniz_oxide v0.9.1
    Checking gix-commitgraph v0.37.1
    Checking rustls-pki-types v1.15.1
    Checking gix-glob v0.26.1
    Checking indexmap v2.14.2
    Checking futures-task v0.3.34
    Checking log v0.4.34
    Checking futures-io v0.3.34
    Checking futures-util v0.3.34
    Checking gix-revwalk v0.32.0
    Checking tokio-util v0.7.19
    Checking icu_normalizer v2.3.0
    Checking icu_properties v2.3.0
    Checking http-body v1.1.0
    Checking flate2 v1.1.10
    Checking gix-lock v23.0.1
   Compiling num-traits v0.2.19
   Compiling syn v2.0.119
   Compiling zmij v1.0.23
   Compiling rustls v0.23.45
   Compiling httparse v1.10.1
    Checking untrusted v0.9.0
    Checking idna_adapter v1.2.2
   Compiling encoding_rs v0.8.41
    Checking futures-channel v0.3.34
    Checking try-lock v0.2.5
    Checking tower-service v0.3.3
    Checking atomic-waker v1.1.2
    Checking unicode-bom v2.0.3
    Checking subtle v2.6.1
    Checking tower-layer v0.3.3
    Checking static_assertions v1.1.0
    Checking h2 v0.4.19
    Checking want v0.3.1
    Checking idna v1.1.0
    Checking form_urlencoded v1.2.2
    Checking gix-config-value v0.18.1
    Checking compression-core v0.4.33
   Compiling serde_json v1.0.151
   Compiling multiversion_no_op v1.0.0
    Checking core_detect v1.0.0
    Checking simdutf8 v0.1.5
    Checking shell-words v1.1.1
    Checking gix-command v0.9.2
    Checking hyper v1.11.1
    Checking compression-codecs v0.4.43
    Checking url v2.5.8
    Checking kstring v2.0.5
    Checking sync_wrapper v1.0.2
    Checking gix-sec v0.14.2
    Checking ipnet v2.12.2
    Checking openssl-probe v0.2.1
    Checking base64 v0.22.1
    Checking rustls-native-certs v0.8.4
    Checking tower v0.5.3
    Checking gix-attributes v0.33.2
    Checking hyper-util v0.1.20
    Checking async-compression v0.4.48
    Checking http-body-util v0.1.5
   Compiling heck v0.5.0
   Compiling crossbeam-epoch v0.9.21
    Checking tower-http v0.6.11
    Checking gix-ref v0.64.0
    Checking gix-url v0.36.2
    Checking gix-packetline v0.21.5
    Checking filetime v0.2.29
    Checking mime v0.3.17
    Checking base64 v0.23.1
    Checking either v1.18.0
   Compiling crossbeam-deque v0.8.8
    Checking gix-prompt v0.15.1
    Checking gix-traverse v0.58.0
    Checking gix-revision v0.46.0
   Compiling zstd-sys v2.1.0+zstd.1.5.7
    Checking gix-bitmap v0.3.3
    Checking hashbrown v0.16.1
    Checking fast_time v0.1.32
   Compiling rayon-core v1.13.0
   Compiling camino v1.2.6
    Checking arrayvec v0.7.8
    Checking uluru v3.1.0
    Checking nm_impl v0.1.50
    Checking gix-refspec v0.42.0
    Checking gix-index v0.52.0
    Checking clru v0.6.3
    Checking gix-credentials v0.38.2
    Checking gix-ignore v0.21.1
   Compiling memoffset v0.9.1
    Checking semver v1.0.28
    Checking utf8parse v0.2.2
    Checking winnow v1.0.4
   Compiling thiserror v1.0.69
   Compiling cfg_aliases v0.2.2
    Checking toml_parser v1.1.3+spec-1.1.0
   Compiling nix v0.30.1
    Checking anstyle-parse v1.0.0
    Checking gix-worktree v0.53.0
    Checking gix-pack v0.71.0
    Checking nm v0.1.50
    Checking gix-config v0.57.0
    Checking gix-filter v0.31.0
    Checking gix-pathspec v0.18.1
   Compiling thiserror-impl v1.0.69
   Compiling maybe-async v0.2.11
    Checking gix-shallow v0.12.1
    Checking gix-negotiate v0.32.0
    Checking arc-swap v1.9.2
   Compiling fs-err v3.3.1
    Checking smol_str v0.3.6
    Checking serde_spanned v1.1.1
    Checking toml_datetime v1.1.1+spec-1.1.0
    Checking io-close v0.3.7
    Checking anstyle v1.0.14
    Checking toml_writer v1.1.2+spec-1.1.0
   Compiling portable-atomic v1.15.0
    Checking colorchoice v1.0.5
   Compiling zstd-safe v8.0.0
    Checking is_terminal_polyfill v1.70.2
    Checking unicode-properties v0.1.4
    Checking bit-vec v0.8.0
    Checking bumpalo v3.20.3
   Compiling typeid v1.0.3
    Checking anstyle-query v1.1.5
    Checking anstream v1.0.0
    Checking zopfli v0.8.3
    Checking bit-set v0.8.0
    Checking ra-ap-rustc_lexer v0.160.0
    Checking toml v1.1.6+spec-1.1.0
error[E0080]: evaluation panicked: unicode-properties and unicode-ident must use the same Unicode version, `unicode_properties::UNICODE_VERSION` and `unicode_ident::UNICODE_VERSION` are different.
  --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ra-ap-rustc_lexer-0.160.0/src/lib.rs:47:9
   |
47 | /         panic!(
48 | |             "unicode-properties and unicode-ident must use the same Unicode version, \
49 | |             `unicode_properties::UNICODE_VERSION` and `unicode_ident::UNICODE_VERSION` are \
50 | |             different."
51 | |         );
   | |_________^ evaluation of `_` failed here

For more information about this error, try `rustc --explain E0080`.
error: could not compile `ra-ap-rustc_lexer` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

-----

error: failed to build rustdoc for crate cargo-aprz-lib v1.1.2
note: this is usually due to a compilation error in the crate,
      and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
      cargo new --lib example &&
          cd example &&
          echo '[workspace]' >> Cargo.toml &&
          cargo add --path /home/runner/work/ox-tools/ox-tools/crates/cargo-aprz-lib --features internals &&
          cargo check &&
          cargo doc

error: aborting due to failure to build rustdoc for crate cargo-aprz-lib v1.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants