-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commit license-metadata.json to git and check it's correct in CI #133453
Conversation
This will tell you if license-metadata.json is out of date.
This comment was marked as resolved.
This comment was marked as resolved.
Could not assign reviewer from: |
:) |
serde_json::from_str(&existing).with_context(|| { | ||
format!("Failed to read existing license JSON at {}", dest.display()) | ||
})?; | ||
if existing_json != output { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking out loud: if we printed a diff here, it could help with inspecting licensing changes performed by PRs. But we already have some tidy checks for that, IIRC, so it's probably overkill.
Thank you, this was a pleasure to review. It's almost as if you're not doing this for the first time 😆 @bors r+ |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#132979 (use `--exact` on `--skip` to avoid unintended substring matches) - rust-lang#133248 (CI: split x86_64-msvc-ext job) - rust-lang#133449 (std: expose `const_io_error!` as `const_error!`) - rust-lang#133453 (Commit license-metadata.json to git and check it's correct in CI) - rust-lang#133457 (miri: implement `TlsFree`) - rust-lang#133493 (do not constrain infer vars in `find_best_leaf_obligation`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133453 - ferrocene:check-license-metadata, r=Kobzol Commit license-metadata.json to git and check it's correct in CI This PR adds `license-metadata.json` to the root of the git repo, and changes `mingw-check` to check that the file is still up-to-date. By committing this file, we remove the need for developers to a) have reuse installed or b) run an expensive ~90 second analysis of the files on disk when they want generate the COPYRIGHT.html files which depend on this license metadata. The file will need updating whenever `REUSE.toml` changes, or when git submodules are added, or when git submodules change their license information (as detected by REUSE). You can now run: * `./x run collect-license-metadata` to update the `./license-metadata.json` file * `./x test collect-license-metadata` to test the `./license-metadata.json` file for correctness The comparison is done with two `serde_json::Value` objects, so the map objects they contain should ignore differences in ordering.
This PR adds
license-metadata.json
to the root of the git repo, and changesmingw-check
to check that the file is still up-to-date.By committing this file, we remove the need for developers to a) have reuse installed or b) run an expensive ~90 second analysis of the files on disk when they want generate the COPYRIGHT.html files which depend on this license metadata.
The file will need updating whenever
REUSE.toml
changes, or when git submodules are added, or when git submodules change their license information (as detected by REUSE).You can now run:
./x run collect-license-metadata
to update the./license-metadata.json
file./x test collect-license-metadata
to test the./license-metadata.json
file for correctnessThe comparison is done with two
serde_json::Value
objects, so the map objects they contain should ignore differences in ordering.