-
Notifications
You must be signed in to change notification settings - Fork 506
Ignore line endings in exclude-file #1889
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
e46e740
8c3808c
c7fb2f3
36ba85f
c47b7a1
3afdaac
f7a398b
cca3ff4
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 |
|---|---|---|
|
|
@@ -628,7 +628,7 @@ def parse_ignore_words_option(ignore_words_option: List[str]) -> Set[str]: | |
| def build_exclude_hashes(filename: str, exclude_lines: Set[str]) -> None: | ||
| with open(filename, encoding="utf-8") as f: | ||
| for line in f: | ||
| exclude_lines.add(line) | ||
| exclude_lines.add(line.rstrip()) | ||
|
|
||
|
|
||
| def build_ignore_words(filename: str, ignore_words: Set[str]) -> None: | ||
|
|
@@ -896,7 +896,7 @@ def parse_file( | |
| return bad_count | ||
|
|
||
| for i, line in enumerate(lines): | ||
| if line in exclude_lines: | ||
| if line.rstrip() in exclude_lines: | ||
|
Collaborator
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. I've realised the issue. This will write back out. See the An input of
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.
It becomes If you don't agree, I can make the changes here, just let me know what test I should be modifying and/or what kind of inputs/outputs should I be checking there.
Contributor
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. ping @peternewman
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. @peternewman do you think I could get your decision here so that I know if this is fine or if I should work on something before this will be able to move forward? 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. ping @peternewman
Collaborator
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.
Odd, as we added the tests here in #2490 and they seem to behave okay, although admittedly they are a slightly different code path to the command line version. What OS were you testing on?
I believe the change you're making will introduce a bug, or perhaps simply further embed an existing bug, so I figure fixing the crucial underlying one first is probably a good idea.
As mentioned, I think we've now done that in #2490 so when that's in, you can just update/rebase and as long as your code continue to pass we'll be all good.
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.
Back then probably only on Windows 10.
That certainly makes sense, I am just not really sure what the issue is exactly. Hopefully, the tests added in #2490 will make it more clear whether there is any issue and if so, what that issue is, thanks for working on those tests. Once that PR gets merged, I'll rebase.
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. I rebased the PR on top of current By the way, in case you don't know, the requirement for approval of workflows for first-time contributors who are NOT new to GitHub can be disabled to decrease the contribution barrier for first-time contributors, see: |
||
| continue | ||
|
|
||
| fixed_words = set() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.