From 8692ce065aa9d2be4e65a505c80b5824bfaf42e2 Mon Sep 17 00:00:00 2001 From: KristinitaTest Date: Fri, 31 Aug 2018 14:44:16 +0300 Subject: [PATCH] ci(sonarqube): try pull request with a code smell! --- sashadebuggingpypideploy/eric_body.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sashadebuggingpypideploy/eric_body.py b/sashadebuggingpypideploy/eric_body.py index 95ace71..bc77f20 100644 --- a/sashadebuggingpypideploy/eric_body.py +++ b/sashadebuggingpypideploy/eric_body.py @@ -38,6 +38,33 @@ def eric_body_function(): "and rerun erichek.") yield False +# I'm a code smell! +def eric_another_body_function(): + """Check, contains body in a file, or no.""" + # Get list all filenames in a directory + # https://stackoverflow.com/a/1120736/5951529 + for filename_pylint in files_loop(): + # Check if string in a file + # https://stackoverflow.com/a/4944929/5951529 + # Encoding for Travis CI, see + # https://stackoverflow.com/a/31492722/5951529 + # https://github.com/travis-ci/travis-ci/issues/8993#issuecomment-354674238 + # https://github.com/travis-ci/travis-ci/issues/8993#issuecomment-354681085 + if "" in open(filename_pylint, encoding='utf-8').read(): + pyfancy_debug(filename_pylint + " contains ") + + else: + pyfancy_critical("File " + + filename_pylint + + " not contain . Please, add in " + + filename_pylint + + ".") + pyfancy_notice("If you see this message and, possibly, long output after them, " + "your file " + filename_pylint + " not contains . " + "Please, add to " + filename_pylint + " to correct place " + "and rerun erichek.") + yield False + # def eric_body_summary(): # """Report, contains in all files or no."""