You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I gradually enable stricter linting rules, I'm using this issue to record specific points. Discussion in the comments is welcome.
wrong-import-order and wrong-import-position
These rules impose a requirement that imports like from app.projects.helpers import workspace appear at the top of the file and after import requests, which must itself come below other Python imports. Since these rules are contradictory, linting fails. It should be possible to disable one of these sub-requirements, but, until then, these rules have been left off.
Jeremy's helpful section headers helped solved this one.
bare-except
Enabling this rule would require a major re-factor since except statements play a variety of roles in the current code base, sometimes catching failures along chains of code. Satisfying the bare minimum with except Exception does not work because the rule considers this insufficiently specific. Applying the rule as intended would probably require a coder with substantial experience using Python exceptions and the time to re-design the code base along lines that, whilst clearly better, might not be possible given the constraints of an academic project. This rule has therefore been left disabled.
Pylintrc CLEAN LOGIC section
Passes all tests locally, but not on Travis.
The text was updated successfully, but these errors were encountered:
I took a quick look, and it looks like ~1/4 of the bare except statements come after a clause containing assert -- and their error text suggests that the exception to be caught is the corresponding AssertionError. I changed those as part of a first pass and pushed it to a bare-except branch to take a look (untested).
I agree that going through the rest would take significant time and maybe should not be high priority ahead of getting to alpha. We can just add clauses to each try as we go, I think -- no major refactor.
Hey, Scott, you mentioned "CLEAN LOGIC" passes all tests locally, but not on Travis. Could you share some error log for that, or a link to the failing Travis build so I could check out the log? Is that all tests being active?
As I gradually enable stricter linting rules, I'm using this issue to record specific points. Discussion in the comments is welcome.
wrong-import-order
andwrong-import-position
These rules impose a requirement that imports likefrom app.projects.helpers import workspace
appear at the top of the file and afterimport requests
, which must itself come below other Python imports. Since these rules are contradictory, linting fails. It should be possible to disable one of these sub-requirements, but, until then, these rules have been left off.Jeremy's helpful section headers helped solved this one.
bare-except
Enabling this rule would require a major re-factor since
except
statements play a variety of roles in the current code base, sometimes catching failures along chains of code. Satisfying the bare minimum withexcept Exception
does not work because the rule considers this insufficiently specific. Applying the rule as intended would probably require a coder with substantial experience using Python exceptions and the time to re-design the code base along lines that, whilst clearly better, might not be possible given the constraints of an academic project. This rule has therefore been left disabled.Pylintrc
CLEAN LOGIC
sectionPasses all tests locally, but not on Travis.
The text was updated successfully, but these errors were encountered: