Uh oh!
There was an error while loading. Please reload this page.
Use str.splitlines() to split lines - #33592
Merged
Merged
Conversation
potiuk
approved these changes
Aug 21, 2023
amoghrajesh
approved these changes
Aug 22, 2023
amoghrajesh
left a comment
Contributor
There was a problem hiding this comment.
Changes look good but the CI is failing with the error:
dev/prepare_release_issue.py:304: error:
"Callable[[str, str, SupportsIndex], str]" has no attribute "splitlines" [attr-defined]
body = " ".join(pr.body.replace.splitlines())
^~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in 1 file (checked 117 source files)
Have you installed the pre commit? Makes it easier to track static checks..
eumiro
commented
Aug 22, 2023
ContributorAuthor
@amoghrajesh thanks, I have it installed, but for some reason disabled yesterday. Now it is fixed. |
Member
There was a problem hiding this comment.
I would keep the with open style and rewrite the reading part to
[re2.sub(r"\s*#.*", "", line) forlineinifile]This would allow the input to be read line by line instead of creating a temporary string before splitting.
ContributorAuthor
There was a problem hiding this comment.
How about
ignore_file_path=Path(root) /ignore_file_nameifignore_file_path.is_file():
uniq_patterns= {}
withignore_file_path.open() asf:
forlineinf:
line=line.strip()
iflineandnotline.startswith("#"):
pattern=ignore_rule_type.compile(line, Path(base_dir_path), ignore_file_path)
ifpattern:
uniq_patterns[pattern] =None# evaluation order of patterns is important with negation# so that later patterns can override earlier patternspatterns=list(uniq_patterns)This probably describes the steps even better, and shows that the ignore_rule_type.compile is called before the patterns are filtered via uniq (dict).
uranusjr
approved these changes
Aug 24, 2023
eumiroforce-pushed
the
splitlines
branch
2 times, most recently
from
August 24, 2023 18:19
b81230b to
981d9a6Compareephraimbuddy pushed a commit
that referenced
this pull request
Oct 5, 2023
(cherry picked from commit 0e00564)
99 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.