Skip to content
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

confusing use of join() #44

Closed
tomato42 opened this issue May 9, 2018 · 0 comments
Closed

confusing use of join() #44

tomato42 opened this issue May 9, 2018 · 0 comments

Comments

@tomato42
Copy link

tomato42 commented May 9, 2018

https://github.com/ansasaki/smap/blob/608f590b98a1ad2e12c078974eafeef8f4aa58fa/src/smap/symver.py#L93-L101

I feel like this would be more readable:

content = ("In file {0.filename}, line {1}, column {0.column}: {0.message}\n"
           "{0.context}"
           "{2:>{0.column}}").format(self, self.line + 1, '^')

(also, does context really include newlines?)

Same issue:
https://github.com/ansasaki/smap/blob/608f590b98a1ad2e12c078974eafeef8f4aa58fa/src/smap/symver.py#L435

Similarly:
https://github.com/ansasaki/smap/blob/608f590b98a1ad2e12c078974eafeef8f4aa58fa/src/smap/symver.py#L458-L461

msg = ("Circular dependency detected!\n"
       "    {0}").format("->".join(current + [dep]))
ansasaki added a commit that referenced this issue May 18, 2018
Avoid the construction of the message if the purpose is just to be sent
as a warning.

Try to use format instead of join when possible.

Try to use generator instead of array comprehension.

Fixes #44, #45, #49, #50
ansasaki added a commit that referenced this issue May 24, 2018
Update existing releases
Fixes #44 
Fixes #45 
Fixes #49 
Fixes #50 
Fixes #65 
Fixes #62 
Fixes #60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant