Skip to content
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

Improve filtering options for Clippy's lint list #7958

Open
Tracked by #79
xFrednet opened this issue Nov 11, 2021 · 5 comments · May be fixed by #12655
Open
Tracked by #79

Improve filtering options for Clippy's lint list #7958

xFrednet opened this issue Nov 11, 2021 · 5 comments · May be fixed by #12655
Labels
A-website Area: Improving the clippy website C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy

Comments

@xFrednet
Copy link
Member

Clippy's lint list currently allows filtering by lint and group. It would be helpful to add more filters for the applicability and version values which are available. The filter design that is currently used is not set in stone, feel free to experiment a bit and make some design suggestions.

The HTML document of the page can be found under util/gh-pages/index.html. cargo dev serve can be used to test the changes locally. The current lint data representation can be found in the gh-pages branch here

Main tracking issue #7172

@xFrednet xFrednet added good-first-issue These issues are a good way to get started with Clippy C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages A-website Area: Improving the clippy website labels Nov 11, 2021
@flip1995
Copy link
Member

flip1995 commented Nov 11, 2021

Possible improvements for the current filters:

  • Group filter:
    • Make drop-down menu
    • Add options to select all / none
  • Lint levels:
    • Possibly the same as for groups?
  • Search
    • Fuzzy search (for lint names)

Possible new filters:

  • Version
    • greater
    • equal
    • less
  • Applicability
    • Filter by applicability group
    • Same interface as the one suggested for groups and levels

Example for drop down menu, screenshot taken from https://toggle.com:
image

@xFrednet
Copy link
Member Author

xFrednet commented Nov 19, 2021

A search only in lint name function would also be nice. (The current string search matches with the lint name and description)

bors added a commit that referenced this issue Mar 10, 2022
…msteffen

Improve styles of filtering options for Clippy's lint list

Particularly solves #7958

Updated styles for filtering options. It now uses dropdown menus.

![image](https://user-images.githubusercontent.com/19844144/144608479-cdd9de0b-f101-4d49-a135-0969efb01a11.png)
bors added a commit that referenced this issue Mar 10, 2022
…msteffen

Improve styles of filtering options for Clippy's lint list

Partially solves #7958

Updated styles for filtering options. It now uses dropdown menus.

![image](https://user-images.githubusercontent.com/19844144/144608479-cdd9de0b-f101-4d49-a135-0969efb01a11.png)

changelog: none
@repi
Copy link

repi commented Apr 24, 2022

Would be great to be able to esp. filter on the version the lint was introduced, use that quite frequently to test lints in newer Rust versions.

@Serial-ATA
Copy link
Contributor

I'll give the version filter a shot

bors added a commit that referenced this issue May 16, 2022
Add version filtering option to the lint list

I'm no web dev, so I don't know if this is the best execution 😄.

Here's how it looks:

![Desktop](https://user-images.githubusercontent.com/69764315/165403602-9e39fe0f-6a96-46cb-ba51-8b035e74cce4.gif)

And on mobile:

![Mobile](https://user-images.githubusercontent.com/69764315/165403908-fc4a0051-2ed4-48a3-b45b-b261f49ce259.png)

I've split this into two commits, in the second one I moved the JS into its own file to make it easier to work on. Is that alright? And if so, could the same thing be done to the css?

changelog: none
cc: #7958, `@repi`
r? `@xFrednet`
bors added a commit that referenced this issue Oct 11, 2022
Add Default to Clippy Lints Lint groups

- related to #7958

This PR adds a default (reset) button to Clippy Lints Lint groups. (change for website)
[The page](https://rust-lang.github.io/rust-clippy/master/index.html) sets only `Deprecated` to false by default.
Certainly it is easy to set only `deprecated` to false, but it may be a bit lazy for beginners.

https://user-images.githubusercontent.com/38400669/194831117-3ade7e0d-c4de-4189-9daf-3be8ea3cdd18.mov

changelog: none
@SpencerAWill
Copy link

I'll take a look at the applicability filter

@SpencerAWill SpencerAWill linked a pull request Apr 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-website Area: Improving the clippy website C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages 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.

5 participants