From 59b345b648f79de74aab261dc1946e5b4a41d7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sun, 16 Jul 2017 18:35:02 +0000 Subject: [PATCH 1/3] Run pyflakes on travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8d00e01..6d7a9cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,11 @@ matrix: install: - pip install -U pip - pip install tox + - pip install pyflakes - sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm script: - tox -e $TOX_ENV + - python -m pyflakes.__main__ $(git ls-files | grep -E "^isso/.+.py$") notifications: irc: channels: From 39debdb0110fd87c15a3acc59b21035cbc791497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sat, 29 Jul 2017 13:06:40 +0000 Subject: [PATCH 2/3] Fix flakes errors. --- isso/__init__.py | 2 -- isso/utils/http.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/isso/__init__.py b/isso/__init__.py index 7795c4f..0a62290 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -220,8 +220,6 @@ def main(): imprt.add_argument("--empty-id", dest="empty_id", action="store_true", help="workaround for weird Disqus XML exports, #135") - serve = subparser.add_parser("run", help="run server") - args = parser.parse_args() conf = config.load(join(dist.location, dist.project_name, "defaults.ini"), args.conf) diff --git a/isso/utils/http.py b/isso/utils/http.py index 48b968b..4bbf443 100644 --- a/isso/utils/http.py +++ b/isso/utils/http.py @@ -44,7 +44,7 @@ class curl(object): self.con = http(host, port, timeout=self.timeout) try: self.con.request(self.method, self.path, headers=self.headers) - except (httplib.HTTPException, socket.error) as e: + except (httplib.HTTPException, socket.error): return None try: From 280b0d925a34e83f6c9fcd75ad9c6213085d75f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sat, 29 Jul 2017 13:09:48 +0000 Subject: [PATCH 3/3] Skip compat module when running flakes checks. Python2-specific code fails on Python3 flakes and vice versa. --- .travis.yml | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d7a9cb..c857936 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ install: - sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm script: - tox -e $TOX_ENV - - python -m pyflakes.__main__ $(git ls-files | grep -E "^isso/.+.py$") + - python -m pyflakes.__main__ $(git ls-files | grep -E "^isso/.+.py$" | grep -v "^isso/compat.py") notifications: irc: channels: diff --git a/Makefile b/Makefile index ff2a55e..2a44cb3 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,9 @@ init: check: @echo "Python 2.x" - -@python2 -m pyflakes $(ISSO_PY_SRC) + @python2 -m pyflakes $(filter-out isso/compat.py,$(ISSO_PY_SRC)) @echo "Python 3.x" - -@python3 -m pyflakes $(ISSO_PY_SRC) + @python3 -m pyflakes $(filter-out isso/compat.py,$(ISSO_PY_SRC)) isso/js/%.min.js: $(ISSO_JS_SRC) $(ISSO_CSS) $(RJS) -o isso/js/build.$*.js out=$@