Replace the metadata collector with tests#13221
Conversation
ad4b186 to
5447e8e
Compare
|
I already saw this PR and was a bit sad to see the monster go. But it has served us well, and maybe it's time for retirement. I've skimmed very quickly skimmed over the changes and like the idea. I'll give it a review this week :D |
|
☔ The latest upstream changes (presumably #13225) made this pull request unmergeable. Please resolve the merge conflicts. |
5447e8e to
a3fbcb8
Compare
a3fbcb8 to
8e66109
Compare
|
☔ The latest upstream changes (presumably #13236) made this pull request unmergeable. Please resolve the merge conflicts. |
8e66109 to
54a1d76
Compare
xFrednet
left a comment
There was a problem hiding this comment.
Very nice implementation. I really like how you collected all the information! It's a bit sad to see my metadata collection monster go, but this implementation is way better IMO!
Thank you for putting in the time!
@flip1995, I've reviewed all changes. If you don't have the time, you can r=me :D
|
@bors r=xFrednet Thanks for reviewing this! I didn't get to review it this weekend (at least not for an in-depth review). I like the new way of testing it though. Great overall improvements! |
Replace the metadata collector with tests The metadata collector handles 3 files: [`CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/CHANGELOG.md#L6050), [`lint_configuration.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/book/src/lint_configuration.md) and `util/gh-pages/lints.json` - `CHANGELOG.md` and `lint_configuration.md` are now checked by `tests/config-metadata.rs`, when they are outdated `cargo test` will fail with a message to run `cargo bless --test config-metadata` in order to update them A plain `cargo bless` will run all the tests, blessing both this and the UI tests - `util/gh-pages/lints.json` is now generated when running `cargo uitest` with `COLLECT_METADATA=1` (still aliased to `cargo collect-metadata`) It uses a `ui_test` [post test action](https://docs.rs/ui_test/latest/ui_test/custom_flags/trait.Flag.html#method.post_test_action) to retrieve the applicability from the actual diagnostics emitted during UI tests Example change from the current to new JSON: ```diff { "id": "chars_next_cmp", - "id_span": { - "path": "src/methods/mod.rs", - "line": 891 - }, + "id_location": "clippy_lints/src/methods/mod.rs#891", "group": "style", "level": "warn", - "docs": "\n### What it does ... ```", + "docs": "### What it does ... ```\n", "version": "pre 1.29.0", - "applicability": { - "is_multi_part_suggestion": false, - "applicability": "Unresolved" - } + "applicability": "MachineApplicable" }, ``` `Hide whitespace` makes the `compile-test.rs` changes much easier to see r? `@flip1995` changelog: none
|
💔 Test failed - checks-action_test |
|
It looks like the |
|
👀 Going to print a diff first, ideally it wouldn't be platform dependent |
54a1d76 to
a9057aa
Compare
|
@bors try |
Replace the metadata collector with tests The metadata collector handles 3 files: [`CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/CHANGELOG.md#L6050), [`lint_configuration.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/book/src/lint_configuration.md) and `util/gh-pages/lints.json` - `CHANGELOG.md` and `lint_configuration.md` are now checked by `tests/config-metadata.rs`, when they are outdated `cargo test` will fail with a message to run `cargo bless --test config-metadata` in order to update them A plain `cargo bless` will run all the tests, blessing both this and the UI tests - `util/gh-pages/lints.json` is now generated when running `cargo uitest` with `COLLECT_METADATA=1` (still aliased to `cargo collect-metadata`) It uses a `ui_test` [post test action](https://docs.rs/ui_test/latest/ui_test/custom_flags/trait.Flag.html#method.post_test_action) to retrieve the applicability from the actual diagnostics emitted during UI tests Example change from the current to new JSON: ```diff { "id": "chars_next_cmp", - "id_span": { - "path": "src/methods/mod.rs", - "line": 891 - }, + "id_location": "clippy_lints/src/methods/mod.rs#891", "group": "style", "level": "warn", - "docs": "\n### What it does ... ```", + "docs": "### What it does ... ```\n", "version": "pre 1.29.0", - "applicability": { - "is_multi_part_suggestion": false, - "applicability": "Unresolved" - } + "applicability": "MachineApplicable" }, ``` `Hide whitespace` makes the `compile-test.rs` changes much easier to see r? `@flip1995` changelog: none
|
💔 Test failed - checks-action_test |
-**Default Value:** `["j", "z", "i", "y", "n", "x", "w"]`
+**Default Value:** `["w", "n", "x", "i", "z", "y", "j"]`Can't say that's what I expected, I'll take a better look at this later |
|
What o.O, that's weird. The good news are that #13084 would fix it, but that PR is still WIP |
a9057aa to
d6f0a28
Compare
|
@bors try |
Replace the metadata collector with tests The metadata collector handles 3 files: [`CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/CHANGELOG.md#L6050), [`lint_configuration.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/book/src/lint_configuration.md) and `util/gh-pages/lints.json` - `CHANGELOG.md` and `lint_configuration.md` are now checked by `tests/config-metadata.rs`, when they are outdated `cargo test` will fail with a message to run `cargo bless --test config-metadata` in order to update them A plain `cargo bless` will run all the tests, blessing both this and the UI tests - `util/gh-pages/lints.json` is now generated when running `cargo uitest` with `COLLECT_METADATA=1` (still aliased to `cargo collect-metadata`) It uses a `ui_test` [post test action](https://docs.rs/ui_test/latest/ui_test/custom_flags/trait.Flag.html#method.post_test_action) to retrieve the applicability from the actual diagnostics emitted during UI tests Example change from the current to new JSON: ```diff { "id": "chars_next_cmp", - "id_span": { - "path": "src/methods/mod.rs", - "line": 891 - }, + "id_location": "clippy_lints/src/methods/mod.rs#891", "group": "style", "level": "warn", - "docs": "\n### What it does ... ```", + "docs": "### What it does ... ```\n", "version": "pre 1.29.0", - "applicability": { - "is_multi_part_suggestion": false, - "applicability": "Unresolved" - } + "applicability": "MachineApplicable" }, ``` `Hide whitespace` makes the `compile-test.rs` changes much easier to see r? `@flip1995` changelog: none
|
💔 Test failed - checks-action_test |
d6f0a28 to
c563b9d
Compare
|
oops @bors try |
Replace the metadata collector with tests The metadata collector handles 3 files: [`CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/CHANGELOG.md#L6050), [`lint_configuration.md`](https://github.com/rust-lang/rust-clippy/blob/c082bc2cb85313901ed3565fcd285592ed93df0f/book/src/lint_configuration.md) and `util/gh-pages/lints.json` - `CHANGELOG.md` and `lint_configuration.md` are now checked by `tests/config-metadata.rs`, when they are outdated `cargo test` will fail with a message to run `cargo bless --test config-metadata` in order to update them A plain `cargo bless` will run all the tests, blessing both this and the UI tests - `util/gh-pages/lints.json` is now generated when running `cargo uitest` with `COLLECT_METADATA=1` (still aliased to `cargo collect-metadata`) It uses a `ui_test` [post test action](https://docs.rs/ui_test/latest/ui_test/custom_flags/trait.Flag.html#method.post_test_action) to retrieve the applicability from the actual diagnostics emitted during UI tests Example change from the current to new JSON: ```diff { "id": "chars_next_cmp", - "id_span": { - "path": "src/methods/mod.rs", - "line": 891 - }, + "id_location": "clippy_lints/src/methods/mod.rs#891", "group": "style", "level": "warn", - "docs": "\n### What it does ... ```", + "docs": "### What it does ... ```\n", "version": "pre 1.29.0", - "applicability": { - "is_multi_part_suggestion": false, - "applicability": "Unresolved" - } + "applicability": "MachineApplicable" }, ``` `Hide whitespace` makes the `compile-test.rs` changes much easier to see r? `@flip1995` changelog: none
|
☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
|
We used |
c563b9d to
a22ce2d
Compare
|
Everything looks good to me, I only now noticed the branch name ^^ Death of a monsterRoses are red, Farewell my friend, RIP |
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Remove unused `collect_metadata` function Leftover from #13221 changelog: none
The metadata collector handles 3 files:
CHANGELOG.md,lint_configuration.mdandutil/gh-pages/lints.jsonCHANGELOG.mdandlint_configuration.mdare now checked bytests/config-metadata.rs, when they are outdatedcargo testwill fail with a message to runcargo bless --test config-metadatain order to update themA plain
cargo blesswill run all the tests, blessing both this and the UI testsutil/gh-pages/lints.jsonis now generated when runningcargo uitestwithCOLLECT_METADATA=1(still aliased tocargo collect-metadata)It uses a
ui_testpost test action to retrieve the applicability from the actual diagnostics emitted during UI testsExample change from the current to new JSON:
{ "id": "chars_next_cmp", - "id_span": { - "path": "src/methods/mod.rs", - "line": 891 - }, + "id_location": "clippy_lints/src/methods/mod.rs#891", "group": "style", "level": "warn", - "docs": "\n### What it does ... ```", + "docs": "### What it does ... ```\n", "version": "pre 1.29.0", - "applicability": { - "is_multi_part_suggestion": false, - "applicability": "Unresolved" - } + "applicability": "MachineApplicable" },Hide whitespacemakes thecompile-test.rschanges much easier to seer? @flip1995
changelog: none