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

Enabled linter on loose files in common. #1976

Merged
merged 8 commits into from
Aug 20, 2020

Conversation

kevinclark19a
Copy link
Contributor

@kevinclark19a kevinclark19a commented Aug 11, 2020

Description

2nd of 7 PRs to enable linter.

Error Codes can be found here: http://pylint.pycqa.org/en/latest/technical_reference/features.html


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines

@codecov
Copy link

codecov bot commented Aug 11, 2020

Codecov Report

Merging #1976 into develop will decrease coverage by 0.01%.
The diff coverage is 73.45%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1976      +/-   ##
===========================================
- Coverage    71.15%   71.13%   -0.02%     
===========================================
  Files           86       86              
  Lines        12285    12286       +1     
  Branches      1729     1730       +1     
===========================================
- Hits          8741     8740       -1     
- Misses        3159     3160       +1     
- Partials       385      386       +1     
Impacted Files Coverage Δ
azurelinuxagent/common/AgentGlobals.py 100.00% <ø> (ø)
azurelinuxagent/common/osutil/gaia.py 27.14% <20.00%> (ø)
azurelinuxagent/common/rdma.py 19.85% <20.83%> (ø)
azurelinuxagent/common/osutil/alpine.py 66.66% <33.33%> (ø)
azurelinuxagent/common/osutil/iosxe.py 42.10% <33.33%> (ø)
azurelinuxagent/common/protocol/util.py 80.32% <38.46%> (ø)
azurelinuxagent/common/osutil/nsbsd.py 41.66% <40.00%> (ø)
azurelinuxagent/common/osutil/openbsd.py 23.37% <40.00%> (ø)
azurelinuxagent/common/utils/cryptutil.py 50.00% <41.66%> (ø)
azurelinuxagent/common/future.py 39.28% <46.66%> (ø)
... and 42 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 c73a8d9...d2cb953. Read the comment docs.

@@ -19,11 +19,11 @@

"""
Module conf loads and parses configuration file
"""
""" # pylint: disable=W0105
Copy link
Member

Choose a reason for hiding this comment

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

does this affect the doctring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error it is suppressing is:
# pointless-string-statement<W0105>: (hi-pri) Used when a string is used as a statement (which of course has no effect). This is a particular case of W0104 with its own message so you can easily disable it if you're using those strings as documentation, instead of comments.

I'm not quite sure what you mean by "affect[ing] the docstring," though.

Copy link
Member

Choose a reason for hiding this comment

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

I wasn't sure if the doctring can have an inline comment. I just double-checked it can,

BTW - This one may be just easier to fix (make this a comment instead of a docstring) than to suppress and fix later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all of these W0105 were auto-marked by the script I wrote, which is part of the reason why they weren't fixed.

If you want, I can go through and fix them. Is this potentially beyond the scope of this PR, though? Since there are so many changes, I'd prefer to limit the number of changes that aren't just the insertion of a comment.

Copy link
Member

Choose a reason for hiding this comment

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

sure, you can leave them as is.

2.7.pylintrc Outdated
@@ -100,8 +100,6 @@ disable=bad-option-value, # pylint does not recognize the error code/symbol (nee
useless-object-inheritance, # Used when a class inherit from object, which under python3 is implicit (3+ only)
duplicate-code # Indicates that a set of similar lines has been detected among multiple file. TODO: this is on our "fix" list, and is thus left last.


# This section controls the duplicate-code error.
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't remove this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, this was a mistake with the merging.

narrieta
narrieta previously approved these changes Aug 19, 2020
narrieta
narrieta previously approved these changes Aug 19, 2020
narrieta
narrieta previously approved these changes Aug 19, 2020
.travis.yml Outdated
@@ -23,25 +23,25 @@ matrix:
- >-
NOSEOPTS="--verbose --with-timer" SETUPOPTS=""
PYLINTOPTS="--rcfile=2.7.pylintrc"
PYLINTFILES="azurelinuxagent/daemon azurelinuxagent/agent.py azurelinuxagent/ga setup.py makepkg.py"
PYLINTFILES="--ignore=osutil,protocol,utils azurelinuxagent/common/ azurelinuxagent/daemon azurelinuxagent/agent.py azurelinuxagent/ga setup.py makepkg.py"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the ignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR was supposed to be just the loose files in common, not the other folders. Somehow, they made it into the PR, though. I can go ahead and remove the ignore.

@kevinclark19a kevinclark19a merged commit a6b00c9 into Azure:develop Aug 20, 2020
@kevinclark19a kevinclark19a deleted the LinterEnabledCommon branch August 20, 2020 17:35
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.

3 participants