-
Notifications
You must be signed in to change notification settings - Fork 47
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 Python linter errors - Part 1 #310
Conversation
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.
@timothyb89 you're ok ?
ci.py
Outdated
@@ -347,7 +347,7 @@ def kill(signal, frame): | |||
def run_push(modules): | |||
if os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != "true": | |||
print('No push permissions in this context, skipping!') | |||
print('Not pushing: %r' % modules) | |||
print('Not pushing: {0!r}'.format(modules)) |
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.
You don't need 0
here.
ci.py
Outdated
@@ -384,7 +384,7 @@ def kill(signal, frame): | |||
def run_readme(modules): | |||
if os.environ.get('TRAVIS_SECURE_ENV_VARS', None) != "true": | |||
print('No Docker Hub permissions in this context, skipping!') | |||
print('Not updating READMEs: %r' % modules) | |||
print('Not updating READMEs: {0!r}'.format(modules)) |
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.
You don't need 0
here.
ci.py
Outdated
@@ -787,8 +785,7 @@ def kill(signal, frame): | |||
|
|||
|
|||
def handle_other(files, modules, tags, pipeline): | |||
print('Unsupported event type "%s", nothing to do.' % ( | |||
os.environ.get('TRAVIS_EVENT_TYPE'))) | |||
print('Unsupported event type "{}", nothing to do.'.format(os.environ.get('TRAVIS_EVENT_TYPE'))) |
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.
I know max length is set to 120 but I would still prefer to stick closer to 80 chars for better diffs on github and shorter lines in editor.
ci.py
Outdated
@@ -438,9 +438,9 @@ def update_docker_compose(modules, pipeline): | |||
try: | |||
with open(CI_COMPOSE_FILE, 'w') as docker_compose: | |||
yaml.dump(compose_dict, docker_compose, default_flow_style=False) | |||
except: | |||
except (RuntimeError, IOError): |
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.
Use EnvironmentError
instead of IOError
https://docs.python.org/2/library/exceptions.html#exceptions.EnvironmentError
and catch also error from yaml
ci.py
Outdated
@@ -449,7 +449,7 @@ def load_yml(yml_path): | |||
with open(yml_path) as compose_file: | |||
compose_dict = yaml.safe_load(compose_file) | |||
return compose_dict | |||
except: | |||
except(RuntimeError, IOError): |
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.
Use EnvironmentError
instead of IOError
https://docs.python.org/2/library/exceptions.html#exceptions.EnvironmentError
and catch also error from yaml
Fixes Python lint errors for #264