Skip to content

link from the lint in the docs to the code #1303

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

Closed
oli-obk opened this issue Oct 27, 2016 · 10 comments · Fixed by #7279
Closed

link from the lint in the docs to the code #1303

oli-obk opened this issue Oct 27, 2016 · 10 comments · Fixed by #7279
Assignees
Labels
A-documentation Area: Adding or improving documentation A-website Area: Improving the clippy website good-first-issue These issues are a good way to get started with Clippy

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 27, 2016

The idea came up in the lint workshop at rustbeltrust

We could simply generate a github search link to the uppercase name of the lint

@oli-obk oli-obk added good-first-issue These issues are a good way to get started with Clippy A-documentation Area: Adding or improving documentation labels Oct 27, 2016
@mcarton
Copy link
Member

mcarton commented Oct 27, 2016

What?

@oli-obk
Copy link
Contributor Author

oli-obk commented Oct 27, 2016

In the lint list ( https://github.com/Manishearth/rust-clippy#lints ) we link to the docs. The suggestion is to also link to the source code of the lint.

@mcarton
Copy link
Member

mcarton commented Oct 27, 2016

Most users should not need this, and having two links in that already quite big table would be confusing 😕
Also, how do you define what the source code of a lint is?

@oli-obk
Copy link
Contributor Author

oli-obk commented Oct 27, 2016

I know, but it could be like the src link in rustdocs, just a small thing.

Well the source is the line where the lint name is mentioned ;)

@mcarton
Copy link
Member

mcarton commented Oct 27, 2016

where the lint name is mentioned

Which one?
If you mean the one where the lint doc is defined, I think that's pretty useless, as the doc is on the wiki/the website. Otherwise, it's not unique.

@oli-obk
Copy link
Contributor Author

oli-obk commented Oct 27, 2016

We can link to a github search url on the clippy repo, that'll list all the use sites

@Manishearth
Copy link
Member

Y'all have a lint workshop? What's it all about? 😀

@llogiq
Copy link
Contributor

llogiq commented Oct 28, 2016

/me jelly. 🤗

@oli-obk
Copy link
Contributor Author

oli-obk commented Oct 28, 2016

I taught ppl how to write clippy lints. But the wireless was down all the time, so it was hard. Also we have a lot of work ahead of us to improve the lint writing experience for new ppl. I've already got a few ideas that I'll explore.

@xFrednet
Copy link
Member

@rustbot claim

bors added a commit that referenced this issue May 5, 2021
…, r=xFrednet

A metadata collection monster

This PR introduces a metadata collection lint as discussed in #4310. It currently collects:
* The lint ID
* The lint declaration file and location (for #1303)
* The lint group
* The documentation
* The applicability (if resolvable)
* If the suggestion is a multi-part-suggestion

This data has a slightly different structure than the current [lints.json](https://github.com/rust-lang/rust-clippy/blob/gh-pages/master/lints.json) and doesn't include depreciated lints yet. I plan to adapt the website to the new format and include depreciated lints in a follow-up PR :). The current collected json looks like this: [metadata_collection.json](https://gist.github.com/xFrednet/6b9e2c3f725f476ba88db9563f67e119)

The entire implementation is guarded behind the `metadata-collector-lint` feature and the `ENABLE_METADATA_COLLECTION` environment value to prevent default collection. You can test the implementation via:
```sh
$ ENABLE_METADATA_COLLECTION=1 cargo test --test dogfood --all-features
```

changelog: none

---

The size of this PR sadly also grew into a small monster, sorry! I definitely plan to improve on this! And it's totally okay if you take your time with this :)

r? `@phansch`
cc: `@flip1995`
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Jul 28, 2021
…ormat, r=flip1995

Adapting the lint list to Clippy's new metadata format

This is close to the end of a long living project to rewrite the lint metadata collection for Clippy. Progress on this has been tracked in rust-lang#7172. This PR adds one of the last missing puzzle pieces, the actual display of all the changes that have been done in the background. A preview can be seen here: [Clippy's lint list](https://xfrednet.github.io/rust-clippy/master/index.html)

The styling has been discussed on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Styling.20feedback.20for.20Clippy's.20lint.20list/near/239601067) but is still open to suggestion.

Side note: It has been fun working on the website where we don't have unit tests and everything is just tested by playing around. However, it's good that this chaos is contained into this one part of Clippy. 🐛

---

Closes: rust-lang#1303
Closes: rust-lang#4310

This actually closes fewer things than I thought it would...

changelog: Reworked Clippy's [website](https://rust-lang.github.io/rust-clippy/master/index.html):
changelog: * Added applicability information about lints
changelog: * Added a link to jump to the specific lint implementation
changelog: * Adapted some styling and improved loading time

r? `@flip1995`
@bors bors closed this as completed in ce46599 Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation A-website Area: Improving the clippy website good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants