-
Notifications
You must be signed in to change notification settings - Fork 17
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 local path new directory #42
Conversation
|
||
while path != pathlib.Path(root or cwd.root): |
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.
not sure when can this freeze here? this should go up the folder tree until root is encountered at which point loop should exit. what am I missing?
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.
Happens in cases when theres no root prefix for the specified file. for e.g
importanize utils/common.py
.
path
value lingers at PosixPath('.')
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.
ah, this method is called without resolving the path. oops
@@ -220,7 +224,8 @@ def run_importanize_on_text(text, config, args): | |||
|
|||
lines = text.splitlines() | |||
for line_number in sorted(groups.all_line_numbers(), reverse=True): | |||
lines.pop(line_number) | |||
if lines: |
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.
thanks. this bombed on on all empty files. introduced this recently
Fixes the following current issues with importanize.