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

Allow error comments above the error site. #199

Merged
merged 1 commit into from
Feb 14, 2024
Merged

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Feb 13, 2024

Clippy has some lints which take comments into account and where the error span encompasses multiple lines. Currently this requires putting the matcher many lines later and then counting the lines. e.g.

if foo {
  foo;
  bar;
  baz;
} else {
  foo;
  bar;
  baz;
} 
//~^^^^^^^^^ ERROR: same if else bodies

This patch allows putting the matcher above, avoiding the problem.

//~v ERROR: same if else bodies
if foo {
  foo;
  bar;
  baz;
} else {
  foo;
  bar;
  baz;
} 

@oli-obk oli-obk merged commit 54c3b89 into oli-obk:main Feb 14, 2024
5 checks passed
@oli-obk
Copy link
Owner

oli-obk commented Feb 14, 2024

neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants