FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(lint): enforce provenance-aware file legal headers by zackees · Pull Request #4061 · FastLED/FastLED · GitHub

feat(lint): enforce provenance-aware file legal headers - #4061

Merged
zackees merged 1 commit into
masterfrom
feat/rust-file-legal-lint
Aug 26, 2026
Merged

feat(lint): enforce provenance-aware file legal headers#4061
zackees merged 1 commit into
masterfrom
feat/rust-file-legal-lint

Conversation

zackees commented Aug 26, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown
Member

Closes #4060.

Summary

  • add dormant Rust machinery for provenance-aware, machine-checkable YAML legal headers
  • reconstruct file history in one Git process, including rename/move tracking across the historical root-to-src migration
  • normalize configured aliases and strip email domains before exact local-identifier alias matching
  • retain MIT license metadata, audit dates, BLAKE3 body fingerprints, and zccache inputs for future activation
  • explicitly disable enforcement and updater writes with enabled: false
  • make no changes under src/**

Current scope

This PR builds and tests the machinery only. It does not insert headers or enforce them. src/third_party/** remains excluded. A later reviewed change can enable the policy and perform a migration.

Validation

  • Rust linter suite: 106/106 passed
  • live Git-history test: Daniel Garcia found on known top-level headers; Sam Guyer found on an ESP32 header
  • synthetic rename test: root-level file moved into src/ retains its original author and creation year
  • direct disabled-checker smoke test against src/FastLED.h: passed
  • git diff origin/master -- src: zero files
  • generated legal-header email hits: zero
  • git diff --check: passed

Summary by CodeRabbit

  • New Features

    • Added automated legal-header compliance checks for project C, C++, and assembly source files.
    • Validates licenses, copyright holders, audit dates, file integrity, formatting, and prohibited identities.
    • Added commands to update legal headers and rescan file history.
    • Preserves existing file formatting, byte-order marks, and author history when updating headers.
  • Bug Fixes

    • Lint caches now refresh when relevant source files or legal-policy settings change.
  • Tests

    • Added coverage for header validation, history tracking, formatting, ownership, and error handling.

coderabbitai Bot commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info ⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e42ab286-da76-4b71-ab94-324aa8c0370c

📥 Commits

Reviewing files that changed from the base of the PR and between 30e7634 and e6769fa.

⛔ Files ignored due to path filters (1)
  • ci/lint_cpp_rs/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • ci/cpp_lint_cache.py
  • ci/dependencies.json
  • ci/lint_cpp/rust_binary_cache.py
  • ci/lint_cpp_rs/Cargo.toml
  • ci/lint_cpp_rs/deep_history_audit.sh
  • ci/lint_cpp_rs/file_legal_policy.yaml
  • ci/lint_cpp_rs/src/checkers/file_legal.rs
  • ci/lint_cpp_rs/src/lib.rs
  • ci/lint_cpp_rs/src/lint_core/prelude_constants.rs
  • ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs
  • ci/lint_cpp_rs/src/lint_core/tests.rs
  • ci/lint_cpp_rs/src/main.rs

📝 Walkthrough

Walkthrough

Adds a Rust file_legal checker for tracked C, C++, and assembly files under src. It validates policy-driven headers, derives attribution from Git history, updates headers, registers CLI modes, and expands cache coverage.

Changes

File legal linting

Layer / File(s) Summary
Policy and cache inputs
ci/lint_cpp_rs/file_legal_policy.yaml, ci/lint_cpp_rs/Cargo.toml, ci/cpp_lint_cache.py, ci/dependencies.json, ci/lint_cpp/rust_binary_cache.py, ci/lint_cpp_rs/src/lint_core/prelude_constants.rs
Adds the legal policy, blake3 and serde_yaml dependencies, C and assembly extensions, and cache inputs for the policy and source files.
Legal checker and header updater
ci/lint_cpp_rs/src/checkers/file_legal.rs
Adds policy loading, legal-header validation, BLAKE3 body hashing, Git history processing, author normalization, header rendering, and byte-preserving file updates.
Checker integration and validation
ci/lint_cpp_rs/src/lib.rs, ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs, ci/lint_cpp_rs/src/main.rs, ci/lint_cpp_rs/src/lint_core/tests.rs, ci/lint_cpp_rs/deep_history_audit.sh
Registers file_legal, adds update and history-rescan CLI modes, tests validation and attribution behavior, and adds a deep history audit script.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant FileLegalChecker
  participant Git
  participant SourceFile
  CLI->>FileLegalChecker: Run legal-header update
  FileLegalChecker->>Git: Collect tracked files and history
  Git-->>FileLegalChecker: Return authors, dates, and renames
  FileLegalChecker->>SourceFile: Validate or render legal header
  FileLegalChecker->>SourceFile: Write changed files
Loading ✨ Finishing Touches 📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rust-file-legal-lint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

fastled-project-sync Bot moved this to In Progress in FastLED Tracker Aug 26, 2026
zackees force-pushed the feat/rust-file-legal-lint branch 6 times, most recently from 3b6f7b1 to e56abf9 Compare August 26, 2026 01:20
zackees force-pushed the feat/rust-file-legal-lint branch from e56abf9 to e6769fa Compare August 26, 2026 01:25
zackees marked this pull request as ready for review August 26, 2026 01:25
zackees merged commit 234520b into master Aug 26, 2026
13 checks passed
zackees deleted the feat/rust-file-legal-lint branch August 26, 2026 01:25
fastled-project-sync Bot moved this from In Progress to Triage in FastLED Tracker Aug 26, 2026
fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Aug 26, 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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat(lint): generate and enforce provenance-aware copyright headers

1 participant


Back | FazBrowse Home | New Git URL