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

ci(sonarqube): try pull request with a code smell! #1

Open
wants to merge 1 commit into
base: SashaPypiDeploy
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions sashadebuggingpypideploy/eric_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<body>" in open(filename_pylint, encoding='utf-8').read():
pyfancy_debug(filename_pylint + " contains <body>")

else:
pyfancy_critical("File " +
filename_pylint +
" not contain <body>. Please, add <body> in " +
filename_pylint +
".")
pyfancy_notice("If you see this message and, possibly, long output after them, "
"your file " + filename_pylint + " not contains <body>. "
"Please, add <body> to " + filename_pylint + " to correct place "
"and rerun erichek.")
yield False


# def eric_body_summary():
# """Report, contains <body> in all files or no."""
Expand Down