Skip to content

Update SPDX checker, and run the automatic fixer in the codebase#1671

Closed
henriquemoody wants to merge 2 commits into
Respect:mainfrom
henriquemoody:housekeeping/spdx
Closed

Update SPDX checker, and run the automatic fixer in the codebase#1671
henriquemoody wants to merge 2 commits into
Respect:mainfrom
henriquemoody:housekeeping/spdx

Conversation

@henriquemoody

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Feb 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (63f7753) to head (7c681fe).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1671      +/-   ##
============================================
- Coverage     99.53%   99.53%   -0.01%     
- Complexity      923      928       +5     
============================================
  Files           190      190              
  Lines          2171     2169       -2     
============================================
- Hits           2161     2159       -2     
  Misses           10       10              

☔ View full report in Codecov by Sentry.
📢 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.

@henriquemoody henriquemoody force-pushed the housekeeping/spdx branch 4 times, most recently from c1c5794 to afee22e Compare February 3, 2026 14:17
…ation

Improves SPDX header linting to ensure consistent license metadata across
the codebase.

Key changes:

- Enforce deterministic tag ordering (License-Identifier, FileCopyrightText,
  FileContributor) to ensure consistency, prevent merge conflicts, and
  simplify code reviews

- Add contributor alias mapping to consolidate contributors with multiple
  emails or name variations (e.g., "nickl-" → "Nick Lombard")

- Add --contributions-strategy option with "blame" (current code authors)
  and "log" (all historical contributors) to support different attribution
  philosophies

- Add optional path argument to lint specific files or directories

- Add --fix option to automatically correct header issues

Assisted-by: Claude Code (claude-opus-4-5-20251101)
I ran the `bin/console spdx --fix` with different strategies for
different files. For most of the core classes, since they've been
drastically rebuilt, I've run it with the `git-blame` strategy, for for
the `src/Validators`, in which the API changed completely but the logic
remains the same, I use the `git-log` strategy.
Comment thread src-dev/Commands/LintSpdxCommand.php
Comment thread src-dev/Spdx/Contributor.php

@alganet alganet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TL;DR Maybe overkill. We don't need to scrape git history more than once or twice. Sad that we don't use Validation internally anymore.

@alganet alganet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm approving despite of the remarks I mentioned previously, so we can quickly unblock the core improvement (a better FileContributor materialization).

Consider them as nitpicks or personal preferences. This is good to merge.

@henriquemoody

Copy link
Copy Markdown
Member Author

I got this in a couple iterations with an AI because I saw myself having to add the header to files I forgot. I think this is more useful for us maintainers than non-frequent contributors

@henriquemoody

Copy link
Copy Markdown
Member Author

I will merge it as is, refactor later, I muyself don't want to spend too much time on it, it's only worth it if it's cheap, but the part of using Validation is a strong argument, we should probably check all the code in src-dev/

@henriquemoody henriquemoody deleted the housekeeping/spdx branch February 3, 2026 15:23
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.

2 participants