Skip to content

Add Pylint #465

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

Merged
merged 13 commits into from
Nov 8, 2018
Merged

Add Pylint #465

merged 13 commits into from
Nov 8, 2018

Conversation

iquintero
Copy link
Contributor

@iquintero iquintero commented Nov 7, 2018

This adds pylint to the build process - will fail for any Warning/Error on the main codebase. Tests are no included yet.

The handling of the MXNet distribution parameter was being done in Framework instead of MXNet. Pylint flagged this so this PR also fixes that. distributions is now also called distribution which is what was originally intended.

Issue #, if available:

Description of changes:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

codecov-io commented Nov 7, 2018

Codecov Report

Merging #465 into master will increase coverage by 0.12%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage      94%   94.13%   +0.12%     
==========================================
  Files          57       57              
  Lines        4284     4259      -25     
==========================================
- Hits         4027     4009      -18     
+ Misses        257      250       -7
Impacted Files Coverage Δ
src/sagemaker/cli/tensorflow.py 50% <ø> (ø) ⬆️
src/sagemaker/transformer.py 100% <ø> (ø) ⬆️
src/sagemaker/cli/mxnet.py 100% <ø> (ø) ⬆️
src/sagemaker/local/image.py 90% <0%> (ø) ⬆️
src/sagemaker/fw_utils.py 100% <100%> (ø) ⬆️
src/sagemaker/model.py 95.58% <100%> (ø) ⬆️
src/sagemaker/local/data.py 93.69% <100%> (-0.22%) ⬇️
src/sagemaker/tensorflow/__init__.py 81.81% <100%> (ø) ⬆️
src/sagemaker/local/local_session.py 88.88% <100%> (ø) ⬆️
src/sagemaker/local/utils.py 96.96% <100%> (ø) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5921325...4963e5b. Read the comment docs.

@iquintero iquintero requested a review from laurenyu November 7, 2018 23:15
.pylintrc Outdated
signature-differs



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the inconsistent number of newlines between sections intentional?

.pylintrc Outdated
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
#ignore-mixin-members=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth keeping around these commented-out config lines?

.pylintrc Outdated
#class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
#
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these empty comment lines?

.pylintrc Outdated
[LOGGING]
# Apply logging string format checks to calls on these modules.
logging-modules=
logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline to the end of the file

CHANGELOG.rst Outdated
@@ -2,6 +2,10 @@
CHANGELOG
=========

1.14.1dev
=========
* bug-fix: rename MXNet argument from accelerators -> accelerator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • add a newline between ll. 6-7
  • also don't you mean distributions -> distribution?
  • does this count as a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and yes

@@ -425,7 +410,7 @@ def _ensure_latest_training_job(self, error_message='Estimator is not associated


class _TrainingJob(_Job):
def __init__(self, sagemaker_session, training_job_name):
def __init__(self, sagemaker_session, training_job_name): # pylint: disable=useless-super-delegation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this one important?

.pylintrc Outdated
# Maximum number of lines in a module
#max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to break the line on this comment?

laurenyu
laurenyu previously approved these changes Nov 8, 2018
ChoiByungWook
ChoiByungWook previously approved these changes Nov 8, 2018
laurenyu
laurenyu previously approved these changes Nov 8, 2018
laurenyu
laurenyu previously approved these changes Nov 8, 2018
laurenyu
laurenyu previously approved these changes Nov 8, 2018
@iquintero iquintero changed the title Add Pylint and improve MXNet distribution handling Add Pylint Nov 8, 2018
@iquintero iquintero merged commit 9145606 into aws:master Nov 8, 2018
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

Successfully merging this pull request may close these issues.

4 participants