Closed marianheil closed 4 years ago
@marianheil Are we still aiming for runscripts to be python 2.x compatible?
Yes unless you know that all nodes are able to use python3 by now. This I broke python2 compatibility somewhere?
I have the feeling the action is not checking the whole code base, i think it would be impossible for all the imports to work when there is no header defined.
I don't understand your comment. flake8
only gives a static code analysis file by file, without checking any includes. Namely we are using pycodestyle (W,E), bugbear (B) and flake's own checks (F). This gives only testing for the basic (syntax) errors.
I don't think it checks the McCabe complexity (C) without setting max-complexity
Ah, I thought it checked whether the imports had everything they were supposed to have. Meaning if I import header
and use header.function_that_doesnt_exist
, shouldn't it fail?
No I don't think so:
$ git diff
diff --git a/src/pyHepGrid/src/main_routines.py b/src/pyHepGrid/src/main_routines.py
index 9afae15..d64f87a 100644
--- a/src/pyHepGrid/src/main_routines.py
+++ b/src/pyHepGrid/src/main_routines.py
@@ -9,6 +9,7 @@ def management_routine(backend, args):
if args.list_disabled:
backend.set_list_disabled()
+ pyHepGrid.src.header.function_that_doesnt_exist("hallo")
if args.get_data and pyHepGrid.src.header.finalisation_script:
backend.get_data(0, custom_get=pyHepGrid.src.header.finalisation_script)
$ flake8 . --show-source --statistics --count
0
The checks are really naive.
oh, nvm, I stand corrected then.
Ever get the feeling that refactoring/testing rates increase proportionally to time spent in lockdown? :P
Ever get the feeling that refactoring/testing rates increase proportionally to time spent in lockdown? :P
By the end of May the survivors will find beautiful code all over github :_)
Can this be merged? We can improve the CI later in a different merge request.
All files should now follow the pep8 style. This shouldn't break anything, but since I changed every single file it is possible that something accidentally got broken.
Please test this changes.
Additionally the code is now checked with flake8 and the bugbear plugin.