diff options
author | Angel Velásquez <angvp@archlinux.org> | 2017-10-18 11:48:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 11:48:40 -0400 |
commit | b788beeeb0788c3e6a3a92b359453c8d45a95d01 (patch) | |
tree | 6dad548ee424cf8146bc19aa628c11ba0179faa6 | |
parent | 031172f8a0b7f073a7b566b9084b6ff8dfc8a215 (diff) | |
parent | d7d448979a68f1b7448604af17d3b4f3b4bd8f37 (diff) | |
download | archweb-b788beeeb0788c3e6a3a92b359453c8d45a95d01.tar.gz archweb-b788beeeb0788c3e6a3a92b359453c8d45a95d01.zip |
Merge pull request #57 from jelly/small_fixes
Make pylint scan all module directory's
-rw-r--r-- | .pylintrc | 27 | ||||
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | devel/tests/test_reporead.py | 2 | ||||
-rw-r--r-- | devel/tests/test_user.py | 2 | ||||
-rw-r--r-- | packages/templatetags/package_extras.py | 5 |
5 files changed, 13 insertions, 26 deletions
@@ -79,26 +79,19 @@ enable=import-self, exec-used, logging-unsupported-format, logging-not-lazy, - unused-variable - -# Things we'd like to enable someday: -# redefined-outer-name (requires a bunch of work to clean up our code first) -# undefined-variable (re-enable when pylint fixes https://github.com/PyCQA/pylint/issues/760) -# no-name-in-module (giving us spurious warnings https://github.com/PyCQA/pylint/issues/73) -# unused-argument (need to clean up or code a lot, e.g. prefix unused_?) - -# Things we'd like to try. -# Procedure: -# 1. Enable a bunch. -# 2. See if there's spurious ones; if so disable. -# 3. Record above. -# 4. Remove from this list. + unused-variable, + deprecated-method, + unreachable, + continue-in-finally, + not-in-loop, + return-outside-function, + unnecessary-lambda, + unnecessary-pass, + # deprecated-method, # anomalous-unicode-escape-in-string, # anomalous-backslash-in-string, - # not-in-loop, # function-redefined, - # continue-in-finally, # abstract-class-instantiated, # star-needs-assignment-target, # duplicate-argument-name, @@ -120,11 +113,9 @@ enable=import-self, # useless-else-on-loop, # expression-not-assigned, # confusing-with-statement, - # unnecessary-lambda, # pointless-statement, # pointless-string-statement, # unnecessary-pass, - # unreachable, # eval-used, # exec-used, # bad-builtin, diff --git a/.travis.yml b/.travis.yml index 94cadeca..0c516624 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,13 @@ language: python python: - "2.7" +cache: pip install: "pip install -r requirements.txt && pip install coveralls pylint" script: - python manage.py collectstatic --noinput - coverage run --rcfile .coveragerc manage.py test - - pylint *.py + - pylint devel main mirrors news packages releng retro templates todolists visualize *.py after_success: - coveralls diff --git a/devel/tests/test_reporead.py b/devel/tests/test_reporead.py index 4e542f4c..f86ab214 100644 --- a/devel/tests/test_reporead.py +++ b/devel/tests/test_reporead.py @@ -5,7 +5,6 @@ from mock import patch from django.core.management import call_command from django.core.management.base import CommandError from django.test import TransactionTestCase -from django.utils.six import StringIO from main.models import Package @@ -29,7 +28,6 @@ class RepoReadTest(TransactionTestCase): self.assertIn('Specified package database file does not exist.', str(e.exception)) def test_read_packages(self): - out = StringIO() with patch('devel.management.commands.reporead.logger') as logger: call_command('reporead', 'x86_64', 'devel/fixtures/core.db.tar.gz') logger.info.assert_called() diff --git a/devel/tests/test_user.py b/devel/tests/test_user.py index 88713bfb..8e32ef93 100644 --- a/devel/tests/test_user.py +++ b/devel/tests/test_user.py @@ -31,7 +31,7 @@ class DevelTest(TestCase): self.assertEqual(response.status_code, 200) def test_admin_log(self): - user = User.objects.create_superuser('admin', 'admin@archlinux.org', 'admin') + User.objects.create_superuser('admin', 'admin@archlinux.org', 'admin') response = self.client.post('/login/', {'username': 'admin', 'password': 'admin'}) response = self.client.get('/devel/admin_log', follow=True) self.assertEqual(response.status_code, 200) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index f9aa086d..de730e29 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -1,8 +1,5 @@ from urllib import urlencode -try: - from urlparse import parse_qs -except ImportError: - from cgi import parse_qs +from urlparse import parse_qs from django import template |