Skip to content

Commit 397d4eb

Browse files
committed
lint: Add flake8 with better defaults
1 parent 29682c0 commit 397d4eb

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: forbid-new-submodules
1212
- id: trailing-whitespace
13+
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.7.9
16+
hooks:
17+
- id: flake8
18+
exclude: .*/migrations/.*|settings/.*

docs/source/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
# NOTE: This entire section should be removed once the old/ folder is removed
4141
# from the docs/ directory.
4242

43-
from recommonmark.parser import CommonMarkParser
44-
from recommonmark.transform import AutoStructify
43+
from recommonmark.transform import AutoStructify # noqa: E402
4544

4645

4746
def setup(app):

junction/conferences/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
from django.conf.urls import include, url
3+
from django.conf.urls import url
44

55
from . import views
66

junction/profiles/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ class ProfileAdmin(admin.ModelAdmin):
66
list_display = ('user', 'city', 'contact_no')
77
search_fields = ('contact_no', 'city')
88

9+
910
admin.site.register(Profile, ProfileAdmin)

junction/proposals/templatetags/proposal_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def is_reviewer_voted(proposal, user, phase=None):
3939
@register.filter(name='get_content_urls')
4040
def get_content_urls(proposal):
4141
if proposal.content_urls:
42-
url_re = 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'
42+
url_re = r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'
4343
urls = re.findall(url_re, proposal.content_urls)
4444
return urls
4545
else:

junction/proposals/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_reviewer_vote_info(user, conference, proposal, vote_phase):
4040
deleted=False,
4141
comment_type=comment_type,
4242
)
43-
except:
43+
except Exception:
4444
vote_comment = None
4545

4646
return psr_vote, vote_comment

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ norecursedirs = .tox .git */migrations/* */static/* docs venv
1414

1515
[flake8]
1616
max-line-length = 120
17-
exclude = .tox,.git,*/migrations/*,*/static/*,docs,venv
1817

1918
[coverage:run]
2019
source = junction/

0 commit comments

Comments
 (0)