-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
Deduplicate violations in the source space #4041
Changes from 10 commits
eeab4b1
d6b3535
cccdcf5
97ce021
45b344c
5aca6c2
bfa94d4
895bf6d
a9681f6
a4584b6
c73b6aa
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 |
---|---|---|
|
@@ -407,8 +407,9 @@ def test__linter__empty_file(): | |
( | ||
False, | ||
[ | ||
("L006", 3, 16), | ||
("L006", 3, 16), | ||
# there are still two of each because L006 checks | ||
# for both *before* and *after* the operator. | ||
# The deduplication filter makes sure there aren't 4. | ||
("L006", 3, 16), | ||
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. Even after deduplication, it looks like there are still 2 occurrences of:
Any idea why? 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. Ah - yeah I can see this is confusing. The rules we're checking is L006, which checks for whitespace before and after the operator. I've added a comment to explain this. 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. Deduplication means that we only get 2 rather than 4. |
||
("L006", 3, 16), | ||
("L006", 3, 39), | ||
|
@@ -418,7 +419,11 @@ def test__linter__empty_file(): | |
], | ||
) | ||
def test__linter__mask_templated_violations(ignore_templated_areas, check_tuples): | ||
"""Test linter masks files properly around templated content.""" | ||
"""Test linter masks files properly around templated content. | ||
|
||
NOTE: this also tests deduplication of fixes which have the same | ||
source position. i.e. `LintedFile.deduplicate_in_source_space()`. | ||
""" | ||
lntr = Linter( | ||
config=FluffConfig( | ||
overrides={ | ||
|
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.
👨🏻🍳 👌🏻