-
Notifications
You must be signed in to change notification settings - Fork 249
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
Fix off-by-1 offset in ripgrep column info #1427
Conversation
Ripgrep uses 0-indexed column values which is not used by other linter output
qlty-check/src/parser/ripgrep.rs
Outdated
@@ -100,9 +100,9 @@ impl Parser for Ripgrep { | |||
path: path.text.clone(), | |||
range: Some(Range { | |||
start_line: line_number, | |||
start_column: submatch.start, | |||
start_column: submatch.start + 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there's a docs page which references this behavior but if not could you please add a comment just clarifying the discovery and the need for this +1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't really found any explicit documentation for this, it was discovered while dogfooding our tools.
qlty-check/src/parser/ripgrep.rs
Outdated
@@ -100,9 +100,9 @@ impl Parser for Ripgrep { | |||
path: path.text.clone(), | |||
range: Some(Range { | |||
start_line: line_number, | |||
start_column: submatch.start, | |||
start_column: submatch.start + 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there's a docs page which references this behavior but if not could you please add a comment just clarifying the discovery and the need for this +1?
The plugin tests might also need updates |
Ripgrep uses 0-indexed column values which is not used by other linter output