Uh oh!
There was an error while loading. Please reload this page.
Auto-generate lint documentation. - #76549
Conversation
ehuss
commented
Sep 10, 2020
I have the following concerns about my approach which I would like some feedback on:
|
0871da1 to
6d82ebbCompare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
wesleywiser
commented
Sep 11, 2020
I think the benefit of having the documentation alongside the lint outweighs any concerns I have about the file length. We should just break those files up as they approach the limit.
I personally think the docs are pretty useful to have right next to the definition so I don't mind this.
I'm not opposed to this but I do agree with your concerns.
I think linking to the rustdoc book would be fine.
The scraping is a bit hacky so I think this is a good idea but I don't think it needs to block this PR. I would be ok with landing this as-is and filing an issue for that enhancement if you don't want to do that in this PR. |
ehuss
commented
Sep 11, 2020
Thanks for the feedback! Sounds good to me. I changed the rustdoc lints to just be links to the rustdoc book. As for the extraction method, I think I'd like to stick with this for now and maybe transition to a |
wesleywiser
commented
Sep 13, 2020
@bors r+ |
bors
commented
Sep 13, 2020
📌 Commit 886b9970eb4e06698b91c848111a628ed3c44dc5 has been approved by |
bors
commented
Sep 13, 2020
⌛ Testing commit 886b9970eb4e06698b91c848111a628ed3c44dc5 with merge 7e5161b068ee2258497ed540c0de0e51e7925b94... |
bors
commented
Sep 13, 2020
💔 Test failed - checks-actions |
…tecture pointer size.
ehuss
commented
Sep 13, 2020
@wesleywiser I forgot to make the |
wesleywiser
commented
Sep 13, 2020
Looks great! @bors r+ |
bors
commented
Sep 13, 2020
📌 Commit 49a61f5 has been approved by |
bors
commented
Sep 14, 2020
bors
commented
Sep 14, 2020
☀️ Test successful - checks-actions, checks-azure |
…ist, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
…ist, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
…ist, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
…ist, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
…ist, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
…t, r=alexcrichton Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolverust-lang#76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in rust-lang#76549.
petrochenkov
commented
Nov 15, 2020
@ehuss |
petrochenkov
commented
Nov 15, 2020
Also the check runs on |
ehuss
commented
Nov 15, 2020
@petrochenkov Sorry this is causing problems. I tried to make the documentation on Removing it from I'm not sure I understand the issue about |
Ok, some user experience report! (From #79078).
|
petrochenkov
commented
Nov 15, 2020
I guess the conclusions are:
|
ehuss
commented
Nov 15, 2020
I see, that does sound frustrating! I'll take a look at a few different things:
|
Aaron1011
commented
Nov 15, 2020
I moved lint definitions to the new |
…imulacrum Validate lint docs separately. This addresses some concerns raised in rust-lang#76549 (comment) about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`. This includes the following changes: * Separate validation to `x.py test`. * Added some more documentation on how to more easily modify and test the docs. * Added more help to the error messages to hopefully provide more information on how to fix things. The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.
…imulacrum Validate lint docs separately. This addresses some concerns raised in rust-lang#76549 (comment) about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`. This includes the following changes: * Separate validation to `x.py test`. * Added some more documentation on how to more easily modify and test the docs. * Added more help to the error messages to hopefully provide more information on how to fix things. The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.
…imulacrum Validate lint docs separately. This addresses some concerns raised in rust-lang#76549 (comment) about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`. This includes the following changes: * Separate validation to `x.py test`. * Added some more documentation on how to more easily modify and test the docs. * Added more help to the error messages to hopefully provide more information on how to fix things. The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.
This adds a tool which will generate the lint documentation in the rustc book automatically. This is motivated by keeping the documentation up-to-date, and consistently formatted. It also ensures the examples are correct and that they actually generate the expected lint. The lint groups table is also auto-generated. See rust-lang/compiler-team#349 for the original proposal.
An outline of how this works:
declare_lint!macro now accepts a doc comment where the documentation is written. This is inspired by how clippy works.src/tools/lint-docsscrapes the documentation and adds it to the rustc book during the build.rustc -W help.I updated the documentation for all the missing lints. I have also added an "Explanation" section to each lint providing a reason for the lint and suggestions on how to resolve it.
This can lead towards a future enhancement of possibly showing these docs via the
--explainflag to make them easily accessible and discoverable.