5

add doc_link_with_quotes lint by cameron1024 · Pull Request #8385 · rust-lang/ru...

 2 years ago
source link: https://github.com/rust-lang/rust-clippy/pull/8385
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Contributor

@cameron1024 cameron1024 commented on Feb 1

edited by llogiq

I'm not sure about wording, it seems OK to me but happy to change if other people have better ideas

closes #8383


changelog: add [doc_link_with_quotes] lint

Collaborator

rust-highfive commented on Feb 1

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) soon.

Please see the contribution instructions for more information.

rust-highfive

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label

on Feb 1

Contributor

@llogiq llogiq left a comment

I think we should look at more cases to ensure the false positive rate is low. The best way would presumably to check if the link text contains a valid path, but that may be too complex.

bar()

}

pub fn bar() {}

Contributor

@llogiq llogiq on Feb 1

I'd like to see a test case against false positives, e.g.

/// ['This week in Rust'](https://this-week-in-rust.org)
fn twir() {}
cameron1024 reacted with thumbs up emoji

Contributor

Author

cameron1024 commented on Feb 2

The particular case that motivated my example was looking for broken links, but I came across something with a broken link and quotes instead of backticks. Ideally the lint would catch these, but I guess that comes at the cost of false positives. Anecdotally, the use of ['something'] seems to be mostly limited to being already within backticks, but I haven't gathered any data for that shrug

Though if by "valid path" you mean a much simpler syntactic check (rather than checking if it points to an actual item), that sounds reasonable. i.e.:

  • ['invalid_identifier,.<>/?'] won't trigger the lint
  • ['valid::but::doesnt::exist'] still would

Does that seem like a good way to go?

llogiq reacted with thumbs up emoji

Contributor

llogiq commented on Feb 5

That's exactly what I meant.

Contributor

bors commented on Feb 11

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

Contributor

llogiq commented on Feb 11

You will need to rebase on master.

Contributor

llogiq commented 5 days ago

So this has waited long enough, I fixed the conflicts. Thanks for your patience.

@bors r+

Contributor

bors commented 5 days ago

pushpin Commit c9be57d has been approved by llogiq

Contributor

bors commented 5 days ago

hourglass Testing commit c9be57d with merge 39231b4...

bors

merged commit 39231b4 into

rust-lang:master 5 days ago

8 checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

llogiq

Assignees

llogiq

Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK