-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add "no-curly-quotes" rule to the codebase. #56
Conversation
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.
Couple notes. Sanity checking as well that this is intended to be enabled for all files and then users can ignore ranges as desired?
src/rules/no_curly_quotes.rs
Outdated
if run.is_upstream() { | ||
return Ok(vec![]); | ||
} |
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.
What's wrong with running this on the upstream and having it behave like a normal linter? This shouldn't need upstream awareness like ICTC does...
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.
I had disabled that for testing - good catch
shoudve put in a donotand
path: path.to_str().unwrap().to_string(), | ||
range: Some(Range { | ||
start: Position { | ||
line: i as u64, |
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.
Are the replacements 1-indexed and the diagnostics are 0-indexed?
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.
If not, the test you added asserts the message, not the diagnostic location
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.
good catch - I shoud standardize this in the diagnostics.rs file where we make every 1 index assuming input is 0 except for startLine and endLine...whoops.
Adds support for nocurlyquotes that will find instances of curlyquotes in a file and replace with correct non-curly form. We had instances of this in our code base and it caused some issues with marketing site.
Fun little rule. Interestingly - this rule exposes a bug in how we apply on
trunk check
sarif fixes for utf-8 non-ascii characters. For now this rule will stay disabled until we have a fix.Fix bug where multiple fixes in a single issue were being turned into multiple issues (which is not what the spec or code was intending to do).