Merge lp:~cjohnston/summit/pylint into lp:summit

Proposed by Chris Johnston
Status: Merged
Approved by: Chris Johnston
Approved revision: 435
Merged at revision: 440
Proposed branch: lp:~cjohnston/summit/pylint
Merge into: lp:summit
Diff against target: 248 lines (+107/-32)
8 files modified
pylint.rc (+83/-0)
requirements.txt (+1/-0)
summit/common/utils.py (+0/-3)
summit/common/views.py (+1/-5)
summit/schedule/forms.py (+0/-9)
summit/schedule/render.py (+2/-2)
summit/schedule/views.py (+18/-11)
summit/sponsor/tests.py (+2/-2)
To merge this branch: bzr merge lp:~cjohnston/summit/pylint
Reviewer Review Type Date Requested Status
Adnane Belmadiaf Approve
Summit Hackers Pending
Review via email: mp+119279@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Adnane Belmadiaf (daker) wrote :

It looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'pylint.rc'
2--- pylint.rc 1970-01-01 00:00:00 +0000
3+++ pylint.rc 2012-08-12 22:34:19 +0000
4@@ -0,0 +1,83 @@
5+[MASTER]
6+profile=no
7+persistent=yes
8+ignore=migrations
9+cache-size=500
10+
11+[MESSAGES CONTROL]
12+# C0111 Missing docstring
13+# I0011 Warning locally suppressed using disable-msg
14+# I0012 Warning locally suppressed using disable-msg
15+# W0704 Except doesn't do anything Used when an except clause does nothing but "pass" and there is no "else" clause
16+# W0142 Used * or * magic* Used when a function or method is called using *args or **kwargs to dispatch arguments.
17+# W0212 Access to a protected member %s of a client class
18+# W0232 Class has no __init__ method Used when a class has no __init__ method, neither its parent classes.
19+# W0613 Unused argument %r Used when a function or method argument is not used.
20+# W0702 No exception's type specified Used when an except clause doesn't specify exceptions type to catch.
21+# R0201 Method could be a function
22+disable=C0111,I0011,I0012,W0704,W0142,W0212,W0232,W0613,W0702,R0201
23+
24+[REPORTS]
25+output-format=parseable
26+include-ids=yes
27+
28+[BASIC]
29+no-docstring-rgx=__.*__|_.*
30+class-rgx=[A-Z_][a-zA-Z0-9_]+$
31+function-rgx=[a-zA_][a-zA-Z0-9_]{2,70}$
32+method-rgx=[a-z_][a-zA-Z0-9_]{2,70}$
33+const-rgx=(([A-Z_][A-Z0-9_]*)|([a-z_][a-z0-9_]*)|(__.*__)|register|urlpatterns)$
34+good-names=_,i,j,k,e,qs,pk,setUp,tearDown
35+
36+[TYPECHECK]
37+
38+# Tells whether missing members accessed in mixin class should be ignored. A
39+# mixin class is detected if its name ends with "mixin" (case insensitive).
40+ignore-mixin-members=yes
41+
42+# List of classes names for which member attributes should not be checked
43+# (useful for classes with attributes dynamically set).
44+ignored-classes=SQLObject
45+
46+# When zope mode is activated, add a predefined set of Zope acquired attributes
47+# to generated-members.
48+zope=no
49+
50+# List of members which are set dynamically and missed by pylint inference
51+# system, and so shouldn't trigger E0201 when accessed.
52+generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
53+
54+# List of method names used to declare (i.e. assign) instance attributes
55+defining-attr-methods=__init__,__new__,setUp
56+
57+
58+[VARIABLES]
59+init-import=no
60+dummy-variables-rgx=_|dummy
61+
62+[SIMILARITIES]
63+min-similarity-lines=6
64+ignore-comments=yes
65+ignore-docstrings=yes
66+
67+
68+[MISCELLANEOUS]
69+notes=FIXME,XXX,TODO
70+
71+
72+[FORMAT]
73+max-line-length=160
74+max-module-lines=500
75+indent-string=' '
76+
77+
78+[DESIGN]
79+max-args=10
80+max-locals=15
81+max-returns=6
82+max-branchs=12
83+max-statements=50
84+max-parents=7
85+max-attributes=7
86+min-public-methods=0
87+max-public-methods=50
88
89=== modified file 'requirements.txt'
90--- requirements.txt 2012-06-29 23:26:00 +0000
91+++ requirements.txt 2012-08-12 22:34:19 +0000
92@@ -19,6 +19,7 @@
93 wsgiref==0.1.2
94 model-mommy==0.7
95 Markdown==2.1.1
96+pylint
97
98 # Non-standard dependencies
99 -f http://launchpad.net/launchpadlib/trunk/1.6.0/+download/launchpadlib-1.6.0.tar.gz#egg=launchpadlib-1.6.0
100
101=== modified file 'summit/common/utils.py'
102--- summit/common/utils.py 2012-01-23 01:18:55 +0000
103+++ summit/common/utils.py 2012-08-12 22:34:19 +0000
104@@ -1,9 +1,6 @@
105 import email
106 import os
107
108-from django.conf import settings
109-
110-
111 def redirect(to, *args, **kwargs):
112 from distutils.version import LooseVersion as V
113 import django
114
115=== modified file 'summit/common/views.py'
116--- summit/common/views.py 2012-05-22 18:57:56 +0000
117+++ summit/common/views.py 2012-08-12 22:34:19 +0000
118@@ -17,11 +17,7 @@
119 from django.shortcuts import render_to_response
120 from django.template.loader import render_to_string
121 from django.template import RequestContext
122-from django.http import HttpResponse, HttpResponseRedirect
123-
124-from django.conf import settings
125-
126-from django.contrib.sites.models import Site
127+from django.http import HttpResponse
128
129 from summit.schedule.models import Summit
130
131
132=== modified file 'summit/schedule/forms.py'
133--- summit/schedule/forms.py 2012-08-05 16:31:15 +0000
134+++ summit/schedule/forms.py 2012-08-12 22:34:19 +0000
135@@ -15,15 +15,6 @@
136 # along with this program. If not, see <http://www.gnu.org/licenses/>.
137
138 from django import forms
139-from django.conf import settings
140-from django.contrib.formtools import wizard
141-from django.http import HttpResponseRedirect
142-from django.utils.safestring import mark_safe
143-from launchpadlib.credentials import Credentials
144-
145-from django.db import models
146-
147-from summit.schedule.fields import NameField
148
149 from summit.schedule.models.meetingmodel import Meeting
150 from summit.schedule.models.attendeemodel import Attendee
151
152=== modified file 'summit/schedule/render.py'
153--- summit/schedule/render.py 2012-08-11 01:23:54 +0000
154+++ summit/schedule/render.py 2012-08-12 22:34:19 +0000
155@@ -1006,8 +1006,8 @@
156 continue
157 if not show_private and meeting.private:
158 continue
159- dtstart = str(slot.start_utc).replace(' ','T', 1).replace(':','',2).replace('-','',2)
160- dtend = str(slot.end_utc).replace(' ','T', 1).replace(':','',2).replace('-','',2)
161+ dtstart = str(slot.start_utc).replace(' ', 'T', 1).replace(':', '', 2).replace('-', '', 2)
162+ dtend = str(slot.end_utc).replace(' ', 'T', 1).replace(':', '', 2).replace('-', '', 2)
163 categories = ','.join([t.title for t in meeting.tracks.all()])
164 ical += '''BEGIN:VEVENT
165 UID:%(id)s
166
167=== modified file 'summit/schedule/views.py'
168--- summit/schedule/views.py 2012-08-08 20:29:24 +0000
169+++ summit/schedule/views.py 2012-08-12 22:34:19 +0000
170@@ -14,14 +14,10 @@
171 # You should have received a copy of the GNU Affero General Public License
172 # along with this program. If not, see <http://www.gnu.org/licenses/>.
173
174-from time import strftime
175 import datetime
176
177 from django.db.models import Q
178-from django.conf import settings
179 from django.contrib.auth import logout
180-from django.contrib.auth.decorators import login_required, permission_required
181-from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
182 from django.http import Http404, HttpResponse, HttpResponseRedirect
183 from django.shortcuts import render_to_response, get_object_or_404
184 from django.template import RequestContext
185@@ -32,11 +28,22 @@
186 summit_only_required,
187 summit_attendee_required)
188
189-from summit.schedule.models import Summit, Slot, Attendee, Meeting, Lead, Track, Room
190+from summit.schedule.models import (Summit,
191+ Slot,
192+ Attendee,
193+ Meeting,
194+ Track,
195+ Room)
196
197 from summit.schedule.render import schedule_factory, Schedule
198
199-from summit.schedule.forms import *
200+from summit.schedule.forms import (CreateMeeting,
201+ OrganizerEditMeeting,
202+ ProposeMeeting,
203+ EditMeeting,
204+ MeetingReview,
205+ AttendMeeting,
206+ OrganizerChangeAttend)
207
208 __all__ = (
209 'summit',
210@@ -328,10 +335,10 @@
211 return _show_meeting(request, summit, meeting, attendee)
212
213 def _show_meeting(request, summit, meeting, attendee):
214- agendaitems=meeting.agenda_set.all()
215- participants=meeting.participant_set.all()
216- attendees=meeting.attendees
217- tracks=meeting.tracks.all()
218+ agendaitems = meeting.agenda_set.all()
219+ participants = meeting.participant_set.all()
220+ attendees = meeting.attendees
221+ tracks = meeting.tracks.all()
222 user_is_attending = attendee is not None and attendee in meeting.attendees
223 user_is_participating = attendee is not None and attendee in [p.attendee for p in participants if not p.from_launchpad]
224
225@@ -693,7 +700,7 @@
226 if not summit.is_organizer(attendee) and attendee != meeting.drafter:
227 return HttpResponseRedirect(reverse('summit.schedule.views.summit', args=(summit.name,)))
228 else:
229- participants=meeting.participant_set.all()
230+ participants = meeting.participant_set.all()
231
232 context = {
233 'summit': summit,
234
235=== modified file 'summit/sponsor/tests.py'
236--- summit/sponsor/tests.py 2012-01-23 01:18:55 +0000
237+++ summit/sponsor/tests.py 2012-08-12 22:34:19 +0000
238@@ -313,8 +313,8 @@
239 self.sponsorship.further_info = '"><script>alert(/xss/)</script>'
240 self.sponsorship.save()
241
242- self.user.first_name= '"><script>alert(/xss/)</script>'
243- self.user.last_name=''
244+ self.user.first_name = '"><script>alert(/xss/)</script>'
245+ self.user.last_name = ''
246 self.user.save()
247
248 self.client.login(username='testscorer', password='password')

Subscribers

People subscribed via source and target branches