Skip to content

Commit

Permalink
Upgrade Flake8 to 3.8, fix new complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed May 29, 2020
1 parent ce4d6ea commit 515dc98
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions chatcommands.py
Expand Up @@ -1332,23 +1332,23 @@ def bisect_number(msg, s):
normalized_match.remove(verbatim_match)
if normalized_match:
l, f = verbatim_match
response = "Matched verbatim on line {} of {}, and also normalized on".format(l, f)
response = "Matched verbatim on line {0} of {1}, and also normalized on".format(l, f)
for l, f in normalized_match:
response += "\n- line {} of {}".format(l, f)
response += "\n- line {0} of {1}".format(l, f)
return response
else:
l, f = verbatim_match
return "Matched verbatim on [line {1} of {2}](https://github.com/{3}/blob/{4}/{2}#L{1})".format(
"", l, f, GlobalVars.bot_repo_slug, GlobalVars.commit.id)
return "Matched verbatim on [line {0} of {1}](https://github.com/{2}/blob/{3}/{1}#L{0})".format(
l, f, GlobalVars.bot_repo_slug, GlobalVars.commit.id)
else:
if len(normalized_match) == 1:
l, f = normalized_match[0]
return "Not matched verbatim, but normalized on " \
"[line {1} of {2}](https://github.com/{3}/blob/{4}/{2}#L{1})".format(
"", l, f, GlobalVars.bot_repo_slug, GlobalVars.commit.id)
"[line {0} of {1}](https://github.com/{2}/blob/{3}/{1}#L{0})".format(
l, f, GlobalVars.bot_repo_slug, GlobalVars.commit.id)
response = "Not matched verbatim, but normalized on"
for l, f in normalized_match:
response += "\n- line {} of {}".format(l, f)
response += "\n- line {0} of {1}".format(l, f)
return response


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -8,7 +8,7 @@ websocket-client>=0.54.0
coverage>=4.5.1
pytest>=4.1.0
phonenumbers>=8.8.11
flake8~=3.6.0
flake8~=3.8.0
pep8-naming==0.7.0
regex>=2018.2.21
termcolor>=1.1.0
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -2,6 +2,7 @@
# Here's a good reference: https://lintlyci.github.io/Flake8Rules/
ignore =
E402, # Module-level import not at top
E741, # Ambiguous variable name (lowercase L)
F401, # Imported but unused
F403, # from import *
F405, # Same as above
Expand Down
2 changes: 1 addition & 1 deletion ws.py
Expand Up @@ -47,7 +47,7 @@
import plugin
except Exception:
exc_type, exc_obj, exc_tb = sys.exc_info()
error_msg = "{}: {}\n".format(exc_type.__name__, exc_obj, traceback.format_tb(exc_tb))
error_msg = "{}: {}\n{}".format(exc_type.__name__, exc_obj, traceback.format_tb(exc_tb))
log('warning', "Error while importing plugin:\n" + error_msg)
# Ignore and move on

Expand Down

0 comments on commit 515dc98

Please sign in to comment.