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

Pre-commit: reintroduce pylint rules #4501

Merged
merged 3 commits into from
Oct 23, 2020
Merged

Conversation

ltalirz
Copy link
Member

@ltalirz ltalirz commented Oct 22, 2020

In 65ad067 the following pylint rules
were accidentally disabled:

  • missing-class-docstring
  • missing-function-docstring
  • too-many-ancestors
  • too-many-locals

This commit reintroduces all but the "too-many-ancestors" rule, which
was deemed not to be helpful, since it has never prompted refactoring in
the past.

@ltalirz
Copy link
Member Author

ltalirz commented Oct 22, 2020

@sphuber I started reducing the number of local variables in a few places until I realized that we had increased the acceptable limit to 20 ;-)

@ltalirz ltalirz requested a review from sphuber October 22, 2020 17:02
@ltalirz ltalirz force-pushed the pylint-rules branch 2 times, most recently from e593f71 to d52fd14 Compare October 22, 2020 17:39
@codecov
Copy link

codecov bot commented Oct 22, 2020

Codecov Report

Merging #4501 into develop will decrease coverage by 0.01%.
The diff coverage is 83.34%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4501      +/-   ##
===========================================
- Coverage    79.37%   79.36%   -0.00%     
===========================================
  Files          475      475              
  Lines        34930    34907      -23     
===========================================
- Hits         27721    27702      -19     
+ Misses        7209     7205       -4     
Flag Coverage Δ
#django 73.23% <83.34%> (-<0.01%) ⬇️
#sqlalchemy 72.45% <83.34%> (-<0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/manage/manager.py 95.18% <ø> (-0.16%) ⬇️
aiida/tools/dbimporters/plugins/mpds.py 29.75% <0.00%> (+0.38%) ⬆️
aiida/tools/importexport/dbexport/__init__.py 98.06% <ø> (ø)
aiida/restapi/resources.py 96.56% <100.00%> (-0.03%) ⬇️
aiida/restapi/translator/nodes/node.py 84.22% <100.00%> (-0.18%) ⬇️
aiida/tools/data/array/kpoints/seekpath.py 100.00% <100.00%> (ø)
aiida/engine/daemon/runner.py 82.76% <0.00%> (+3.45%) ⬆️

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 c6d38c1...23757ab. Read the comment docs.

@@ -10,6 +10,9 @@
"""
This allows to manage showfunctionality to all data types.
"""
import sys
Copy link
Member

Choose a reason for hiding this comment

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

Could those have been put in the functions to improve startup performance?

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

you're right, here it makes sense to move imports inside functions (although those system libraries are likely imported somewhere anyhow)

In 65ad067 the following pylint rules
were accidentally disabled:

 * missing-class-docstring
 * missing-function-docstring
 * too-many-ancestors
 * too-many-locals

This commit reintroduces all but the "too-many-ancestors" rule, which
was deemed not to be helpful, since it has never prompted refactoring in
the past.
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @ltalirz

@sphuber sphuber merged commit 1be12e1 into aiidateam:develop Oct 23, 2020
@sphuber sphuber deleted the pylint-rules branch October 23, 2020 13:33
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