How do we approach the linting checks
See original GitHub issueI ran pylint
on pymbar
so we only get warnings and errors (omitted style lint and the output from old_mbar.py
and tests
).
pylint --disable=all --enable=W,E pymbar/ --disable=W0511
This is the output
************* Module pymbar
pymbar/__init__.py:31:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/__init__.py:40:0: W0702: No exception type(s) specified (bare-except)
pymbar/__init__.py:39:4: W0406: Module import itself (import-self)
************* Module pymbar.utils
pymbar/utils.py:26:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/utils.py:374:4: W0107: Unnecessary pass statement (unnecessary-pass)
pymbar/utils.py:383:4: W0107: Unnecessary pass statement (unnecessary-pass)
pymbar/utils.py:392:4: W0107: Unnecessary pass statement (unnecessary-pass)
pymbar/utils.py:401:4: W0107: Unnecessary pass statement (unnecessary-pass)
************* Module pymbar.mbar
pymbar/mbar.py:40:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/mbar.py:418:100: W1619: division w/o __future__ statement (old-division)
pymbar/mbar.py:467:20: W0612: Unused variable 'eigevec' (unused-variable)
pymbar/mbar.py:564:33: W0613: Unused argument 'warning_cutoff' (unused-argument)
pymbar/mbar.py:982:8: W0612: Unused variable 'N' (unused-variable)
pymbar/mbar.py:1093:8: W0612: Unused variable 'K' (unused-variable)
pymbar/mbar.py:1113:8: W0612: Unused variable 'expectations' (unused-variable)
pymbar/mbar.py:1113:22: W0612: Unused variable 'uncertainties' (unused-variable)
pymbar/mbar.py:1113:37: W0612: Unused variable 'covariances' (unused-variable)
pymbar/mbar.py:1190:8: W0612: Unused variable 'Deltaf_ij' (unused-variable)
pymbar/mbar.py:1190:19: W0612: Unused variable 'dDeltaf_ij' (unused-variable)
pymbar/mbar.py:1258:11: W0612: Unused variable 'N' (unused-variable)
pymbar/mbar.py:1455:13: W0612: Unused variable 'U' (unused-variable)
pymbar/mbar.py:40:0: W0611: Unused import math (unused-import)
pymbar/mbar.py:43:0: W0611: Unused import warnings (unused-import)
************* Module pymbar.utils_for_testing
pymbar/utils_for_testing.py:22:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/utils_for_testing.py:76:4: W0612: Unused variable 'x_n' (unused-variable)
pymbar/utils_for_testing.py:88:4: W0612: Unused variable 'x_n' (unused-variable)
************* Module pymbar.exp
pymbar/exp.py:47:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/exp.py:118:13: W1619: division w/o __future__ statement (old-division)
pymbar/exp.py:121:19: W1619: division w/o __future__ statement (old-division)
pymbar/exp.py:195:14: W1619: division w/o __future__ statement (old-division)
pymbar/exp.py:195:44: W1619: division w/o __future__ statement (old-division)
************* Module pymbar.confidenceintervals
pymbar/confidenceintervals.py:22:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/confidenceintervals.py:42:10: W1619: division w/o __future__ statement (old-division)
pymbar/confidenceintervals.py:92:4: W0622: Redefining built-in 'sum' (redefined-builtin)
pymbar/confidenceintervals.py:96:14: W1619: division w/o __future__ statement (old-division)
pymbar/confidenceintervals.py:108:33: W1619: division w/o __future__ statement (old-division)
pymbar/confidenceintervals.py:262:28: W1619: division w/o __future__ statement (old-division)
pymbar/confidenceintervals.py:265:43: W1619: division w/o __future__ statement (old-division)
pymbar/confidenceintervals.py:270:12: E1101: Module 'scipy.special' has no 'erf' member (no-member)
pymbar/confidenceintervals.py:311:4: W0612: Unused variable 'aveerr' (unused-variable)
************* Module pymbar.timeseries
pymbar/timeseries.py:58:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/timeseries.py:318:12: W1619: division w/o __future__ statement (old-division)
pymbar/timeseries.py:321:12: W1619: division w/o __future__ statement (old-division)
pymbar/timeseries.py:451:4: W0612: Unused variable 'g' (unused-variable)
pymbar/timeseries.py:611:12: W1619: division w/o __future__ statement (old-division)
pymbar/timeseries.py:713:18: W1638: range built-in referenced when not iterating (range-builtin-not-iterating)
pymbar/timeseries.py:718:18: W1633: round built-in referenced (round-builtin)
pymbar/timeseries.py:719:20: W1633: round built-in referenced (round-builtin)
pymbar/timeseries.py:797:20: W1619: division w/o __future__ statement (old-division)
pymbar/timeseries.py:910:28: W1619: division w/o __future__ statement (old-division)
************* Module pymbar.mbar_solvers
pymbar/mbar_solvers.py:2:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/mbar_solvers.py:316:18: E1307: Argument '.ndarray' does not match format type 'g' (bad-string-format-type)
pymbar/mbar_solvers.py:316:18: E1307: Argument '.ndarray' does not match format type 'g' (bad-string-format-type)
pymbar/mbar_solvers.py:521:8: W0612: Unused variable 'k' (unused-variable)
pymbar/mbar_solvers.py:554:21: W0612: Unused variable 'all_results' (unused-variable)
************* Module pymbar.bar
pymbar/bar.py:49:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/bar.py:121:4: W0702: No exception type(s) specified (bare-except)
pymbar/bar.py:138:4: W0702: No exception type(s) specified (bare-except)
pymbar/bar.py:262:19: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:281:62: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:294:21: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:310:34: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:451:-1: W0105: String statement has no effect (pointless-string-statement)
pymbar/bar.py:482:15: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:485:24: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:485:44: W1619: division w/o __future__ statement (old-division)
pymbar/bar.py:50:0: W0611: Unused import numpy.linalg (unused-import)
************* Module pymbar.pmf
pymbar/pmf.py:24:0: W1618: import missing `from __future__ import absolute_import` (no-absolute-import)
pymbar/pmf.py:367:27: E1101: Module 'numpy.random' has no 'RandomState' member (no-member)
pymbar/pmf.py:517:48: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:636:22: W0212: Access to a protected member _computeUnnormalizedLogWeights of a client class (protected-access)
pymbar/pmf.py:699:16: W0612: Unused variable 'df_i' (unused-variable)
pymbar/pmf.py:885:36: W0622: Redefining built-in 'type' (redefined-builtin)
pymbar/pmf.py:1022:30: W0212: Access to a protected member _computeUnnormalizedLogWeights of a client class (protected-access)
pymbar/pmf.py:1034:31: W0212: Access to a protected member _computeAsymptoticCovarianceMatrix of a client class (protected-access)
pymbar/pmf.py:1373:43: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1266:8: W0612: Unused variable 'K' (unused-variable)
pymbar/pmf.py:1350:24: W0612: Unused variable 'Neff' (unused-variable)
pymbar/pmf.py:1361:12: W0612: Unused variable 'maxgc' (unused-variable)
pymbar/pmf.py:1362:12: W0612: Unused variable 'meangc' (unused-variable)
pymbar/pmf.py:1481:38: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1482:38: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1529:12: W0612: Unused variable 'cold' (unused-variable)
pymbar/pmf.py:1626:26: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1633:36: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1579:12: W0613: Unused argument 'nspline' (unused-argument)
pymbar/pmf.py:1580:12: W0613: Unused argument 'kdegree' (unused-argument)
pymbar/pmf.py:1583:12: W0613: Unused argument 'xrangei' (unused-argument)
pymbar/pmf.py:1584:12: W0613: Unused argument 'xrangeij' (unused-argument)
pymbar/pmf.py:1586:12: W0613: Unused argument 'dlogprior' (unused-argument)
pymbar/pmf.py:1587:12: W0613: Unused argument 'ddlogprior' (unused-argument)
pymbar/pmf.py:1761:35: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1674:12: W0613: Unused argument 'kdegree' (unused-argument)
pymbar/pmf.py:1678:12: W0613: Unused argument 'xrangeij' (unused-argument)
pymbar/pmf.py:1679:12: W0613: Unused argument 'logprior' (unused-argument)
pymbar/pmf.py:1681:12: W0613: Unused argument 'ddlogprior' (unused-argument)
pymbar/pmf.py:1865:47: W0640: Cell variable i defined in loop (cell-var-from-loop)
pymbar/pmf.py:1865:64: W0640: Cell variable j defined in loop (cell-var-from-loop)
pymbar/pmf.py:1870:39: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1881:42: W1619: division w/o __future__ statement (old-division)
pymbar/pmf.py:1793:12: W0613: Unused argument 'w_n' (unused-argument)
pymbar/pmf.py:1794:12: W0613: Unused argument 'x_n' (unused-argument)
pymbar/pmf.py:1798:12: W0613: Unused argument 'xrange' (unused-argument)
pymbar/pmf.py:1799:12: W0613: Unused argument 'xrangei' (unused-argument)
pymbar/pmf.py:1801:12: W0613: Unused argument 'logprior' (unused-argument)
pymbar/pmf.py:1802:12: W0613: Unused argument 'dlogprior' (unused-argument)
pymbar/pmf.py:1893:25: W0613: Unused argument 'spline_parameters' (unused-argument)
pymbar/pmf.py:756:29: E0203: Access to member 'kde' before its definition line 762 (access-member-before-definition)
pymbar/pmf.py:355:8: W0201: Attribute 'pmf_type' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:363:8: W0201: Attribute 'u_n' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:373:8: W0201: Attribute 'nbootstraps' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:378:8: W0201: Attribute 'pmf_function' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:851:20: W0201: Attribute 'pmf_function' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:386:8: W0201: Attribute 'mc_data' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1315:8: W0201: Attribute 'mc_data' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:390:12: W0201: Attribute 'histogram_datas' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:401:12: W0201: Attribute 'dims' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:402:12: W0201: Attribute 'histogram_parameters' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:406:12: W0201: Attribute 'kdes' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:430:12: W0201: Attribute 'bspline' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:596:12: W0201: Attribute 'bspline' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:785:20: W0201: Attribute 'bspline' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:848:20: W0201: Attribute 'bspline' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:431:12: W0201: Attribute 'pmf_functions' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:433:12: W0201: Attribute 'spline_parameters' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:595:12: W0201: Attribute 'bspline_derivatives' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:597:12: W0201: Attribute 'fkbias' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:640:12: W0201: Attribute 'w_n' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:641:12: W0201: Attribute 'w_n' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:643:12: W0201: Attribute 'w_kn' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:743:20: W0201: Attribute 'histogram_data' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:762:20: W0201: Attribute 'kde' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:863:20: W0201: Attribute 'aic' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:868:20: W0201: Attribute 'bic' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1325:8: W0201: Attribute 'naccept' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1568:12: W0201: Attribute 'naccept' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1328:8: W0201: Attribute 'first_step' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1530:12: W0201: Attribute 'first_step' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1527:12: W0201: Attribute 'previous_logposterior' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1567:12: W0201: Attribute 'previous_logposterior' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1532:12: W0201: Attribute 'newspline' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1535:8: W0201: Attribute 'cold' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1566:12: W0201: Attribute 'cold' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1659:8: W0201: Attribute 'bspline_expf' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1660:8: W0201: Attribute 'bspline_pF' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1786:8: W0201: Attribute 'bspline_gkquad' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1787:8: W0201: Attribute 'bspline_pE' defined outside __init__ (attribute-defined-outside-init)
pymbar/pmf.py:1949:-1: W0105: String statement has no effect (pointless-string-statement)
pymbar/pmf.py:27:0: W0611: Unused numpy.linalg imported as linalg (unused-import)
pymbar/pmf.py:31:0: W0611: Unused kn_to_n imported from pymbar.utils (unused-import)
pymbar/pmf.py:31:0: W0611: Unused check_w_normalized imported from pymbar.utils (unused-import)
pymbar/pmf.py:42:0: W0611: Unused import pdb (unused-import)
I can get rid of most of that noise, but there are some non trivial changes that will require the intervention of somebody more familiar with the code. Should I proceed with the PR anyway?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Lint Checks · oppia/oppia Wiki - GitHub
When adding a new lint check, you should follow the following approach: Identify what types of files your lint check needs to evaluate....
Read more >Best practices for Linting - Webapp.io
Linters are programs that look at a program's source code and find problems automatically. They are a common feature of pull request ...
Read more >Bundling and Testing Lint Checks - Medium
A TDD (test driven development) approach is recommended when building custom Lint checks. It's a perfect use-case — provide a sample file ...
Read more >What Is a Linter? Here's a Definition and Quick-Start Guide
Another vital type of check that linters provide is adherence to coding standards. Some people might dismiss this as a purely aesthetic concern, ......
Read more >Lint Code: What Is Linting + When To Use Lint Tools | Perforce
Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, start a PR with these, rerun lint on that PR, and I will take a look the remaining ones this weekend.
Addressed by #367