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

Clippy Book Chapter Updates Reborn: Defining Lints #10595

Merged
merged 7 commits into from
Aug 16, 2023

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented Apr 4, 2023

Revival of #9659, I've made a few changes (mainly ones from reviews from #9426, like removing mid-section storytelling) and some re-writes. The goal of the project would be to slowly re-write the Clippy book (only chapters that need it) to more up-to-date style.

Notes

  • Things like git status commands have changed, we need to make sure that they're correct.
  • As this is a team-wide effort, I would please ask anyone and everyone to read it and give your opinion.
  • To talk about the whole project, please use the tracking issue for the project [Tracking issue] Project: Clippy Book Chapter Updates Reborn #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Defining lints" chapter to the book

r? @flip1995

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 4, 2023
@blyxyas
Copy link
Member Author

blyxyas commented Apr 4, 2023

I consider documentation very important and a team-wide effort, could you please read it and give your opinions (On a review or a one-off comment)?
@rustbot ping clippy

@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2023

Error: The feature ping is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@blyxyas
Copy link
Member Author

blyxyas commented Apr 4, 2023

Weird

cc @rust-lang/clippy

@bors
Copy link
Contributor

bors commented Apr 8, 2023

☔ The latest upstream changes (presumably #10605) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not completely clear about the planned extent of this chapter, so I'm not sure if there's anything missing, but what I see looks good.

Perhaps adding some copy from the created files to show what should be changed (notably the lint declaration itself, e.g. the version annotation often trips up newbies) might help, but also take up some space, and I'm not sure if you want to tackle that in a "documenting lints" chapter.

is an `early` lint pass. We will discuss this difference in a later chapter.
<!-- FIXME: Link that "later chapter" when lint_passes.md is merged -->
2. If not provided, the `category` of this new lint will default to `nursery`.
See Clippy's [lint types](../lints.md) for more information on categories.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we have lint types linking to the upper chapter, and elsewhere there's a Lint Types heading, which makes me think the term might be overloaded. If so, could we find a more apt term here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe changing that to link to the later section "Lint types", and adding a note in "Lint types" about how there's more information in ../lints.md could clear the confusion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the latest commit would solve the issue.

bors added a commit that referenced this pull request Apr 14, 2023
Clippy Book Chapter Updates Reborn: Lint Passes

This PR adds a new chapter to the book: "Lint passes". No major changes apart from some re-phrasing, fixing typos... etc.

## Notes

- Requires #10595 to be merged before this one (Or else, a link will be broken).
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Lint passes" chapter to the book
r? `@flip1995`
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like this documentation get way slimmer. This still seems like a lot of stuff is copied over from adding_lints.md. This should be a short explanation on how to create lints. The example for foo_functions should be almost completely removed. I would either replace it with some generic lint_name in the example commands or keep the name, but then don't talk about what it does at all. This should go into a full-tutorial documentation, like what adding_lints is today.

I would also move the Lint Types up.

I'm unsure if Lint Name is placed well in this chapter. I'm inclined to completely remove it or slim it down to just one sentence that points to lint naming guidelines.

And finally, as llogiq pointed out, I would at least copy the define_clippy_lints macro that is generated into this documentation and explain each part and how it should be updated (documentation + version) before submitting the lint.


Basically what I'd like this document to become is a quick overview/collection of commands that could be run to generate new lints plus explanation what is generated, if it has to be generated manually.

book/src/development/defining_lints.md Outdated Show resolved Hide resolved
book/src/development/defining_lints.md Outdated Show resolved Hide resolved
book/src/development/defining_lints.md Show resolved Hide resolved
book/src/development/defining_lints.md Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Apr 16, 2023

☔ The latest upstream changes (presumably #10653) made this pull request unmergeable. Please resolve the merge conflicts.

@blyxyas
Copy link
Member Author

blyxyas commented Jun 3, 2023

The latest commits should fix all issues

Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only formatting changes left to do. I will address them myself and then merge this.

Amazing work. I will use this PR to apologize again, for not reviewing for so long. But I took a week of vacation from $day_job and can now give those PR the attention and time they deserve.

book/src/development/defining_lints.md Outdated Show resolved Hide resolved
Comment on lines 28 to 30
These types group together lints that share some common behaviors.
For instance, `functions` groups together lints
that deal with some aspects of function calls in Rust.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking: We might want to add a one-line description for each type in the list above.

Question: Are function lints really about function calls, rather than function signatures/declarations? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is mostly about declarations/signatures. I changed the wording a bit here.

book/src/development/defining_lints.md Outdated Show resolved Hide resolved
book/src/development/defining_lints.md Outdated Show resolved Hide resolved
book/src/development/defining_lints.md Outdated Show resolved Hide resolved
book/src/development/defining_lints.md Outdated Show resolved Hide resolved
@flip1995
Copy link
Member

@bors r+

I also rebased the branch on top of latest master. Let's get those PRs in :shipit:

@bors
Copy link
Contributor

bors commented Aug 16, 2023

📌 Commit 783c119 has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 16, 2023

⌛ Testing commit 783c119 with merge 87d1487...

@bors
Copy link
Contributor

bors commented Aug 16, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 87d1487 to master...

@bors
Copy link
Contributor

bors commented Aug 16, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 87d1487 to master...

@bors bors merged commit 87d1487 into rust-lang:master Aug 16, 2023
3 checks passed
bors added a commit that referenced this pull request Aug 16, 2023
Clippy Book Chapter Updates Reborn: Method Checking

This PR adds a new chapter to the book: "Method Checking". Some major re-phrasing was done and some changes in the code comments (apart from grammar and minor changes).

## Notes

- Requires #10595 **and** #10622 to be merged before this, or else several links will be broken
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Method Checking" chapter to the book.

r? `@flip1995`
@blyxyas blyxyas deleted the book-define_lints branch October 5, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants