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 an offense creation for Lint/EmptyFile
#8676
Fix an offense creation for Lint/EmptyFile
#8676
Conversation
Can you explain why those changes are needed? Personally, I don't quite get it. |
I thought the HTML formatter was the culprit (or maybe even my rewriter code) |
The original code range = source_range(processed_source.buffer, 1, 0)
add_offense(range) adds an offense to non existent (empty) source range - 1st line, 0-th column. 119 and 124 lines fails here because of
|
Got it. Might be nice to integrate those global offenses with |
|
I think: source_range(processed_source.buffer, 1, 0)
# should be
source_range(processed_source.buffer, 1, 0, 0) FWIW, this helper is terrible. There are too many of these multiple argument public methods... The cop in charge of that should really have different settings for private (I don't care much, really) and public (should be max 1 imo). If you prefer to go the |
Just tested, the same error as in the original issue. |
Well, I guess the suggested fix will do for now. Thanks! |
Closes #8669