-
Notifications
You must be signed in to change notification settings - Fork 17k
[utils][filecheck-lint]: speedup filecheck_lint #94191
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,27 +49,15 @@ def test_find_potential_directives_comment_prefix(self): | |
| results = list(fcl.find_potential_directives(content)) | ||
| assert len(results) == 3 | ||
| pos, match = results[0] | ||
| assert ( | ||
| pos.line == 1 | ||
| and pos.start_column == len("junk; ") + 1 | ||
| and pos.end_column == len(lines[0]) - 1 | ||
| ) | ||
| assert pos.as_str() == "1:7-11" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind deriving your string here (and below) using the previous
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you describe what you mean?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry---I was not clear. I meant to ask whether I think this makes the expected behaviour clearer.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like copypaste and not maintainable - change in input lines only will break tests without fixes here too.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The same tests will break in both cases.
Adding a comment here is strictly worse; that too will get out of sync, but will do so completely silently since the comment doesn't get executed. Anyway, this is not a huge deal, and you seem to feel strongly about this, so let's keep it as is. |
||
| assert match == "CHCK1" | ||
|
|
||
| pos, match = results[1] | ||
| assert ( | ||
| pos.line == 2 | ||
| and pos.start_column == len("junk// ") + 1 | ||
| and pos.end_column == len(lines[1]) - 1 | ||
| ) | ||
| assert pos.as_str() == "2:8-12" | ||
| assert match == "CHCK2" | ||
|
|
||
| pos, match = results[2] | ||
| assert ( | ||
| pos.line == 3 | ||
| and pos.start_column == 1 | ||
| and pos.end_column == len(lines[2]) - 1 | ||
| ) | ||
| assert pos.as_str() == "3:1-10" | ||
| assert match == "SOME CHCK3" | ||
|
|
||
| def test_levenshtein(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.