Skip to content

Commit 0655dd8

Browse files
committedFeb 15, 2017
🆕 Integrate pylint into the project
This patch will integrate pylint in to the project as well as adding it to the travis ci.
1 parent 8b399fc commit 0655dd8

9 files changed

+392
-9
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ install:
1010
- python setup.py install
1111

1212
script:
13-
- true # do nothing for now.
13+
- pylint

‎pylintrc

+378
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,378 @@
1+
[MASTER]
2+
3+
# Specify a configuration file.
4+
#rcfile=
5+
6+
# Python code to execute, usually for sys.path manipulation such as
7+
# pygtk.require().
8+
#init-hook=
9+
10+
# Add files or directories to the blacklist. They should be base names, not
11+
# paths.
12+
ignore=CVS
13+
14+
# Pickle collected data for later comparisons.
15+
persistent=yes
16+
17+
# List of plugins (as comma separated values of python modules names) to load,
18+
# usually to register additional checkers.
19+
load-plugins=
20+
21+
# Use multiple processes to speed up Pylint.
22+
jobs=1
23+
24+
# Allow loading of arbitrary C extensions. Extensions are imported into the
25+
# active Python interpreter and may run arbitrary code.
26+
unsafe-load-any-extension=no
27+
28+
# A comma-separated list of package or module names from where C extensions may
29+
# be loaded. Extensions are loading into the active Python interpreter and may
30+
# run arbitrary code
31+
extension-pkg-whitelist=
32+
33+
# Allow optimization of some AST trees. This will activate a peephole AST
34+
# optimizer, which will apply various small optimizations. For instance, it can
35+
# be used to obtain the result of joining multiple strings with the addition
36+
# operator. Joining a lot of strings can lead to a maximum recursion error in
37+
# Pylint and this flag can prevent that. It has one side effect, the resulting
38+
# AST will be different than the one from reality.
39+
optimize-ast=no
40+
41+
42+
[MESSAGES CONTROL]
43+
44+
# Only show warnings with the listed confidence levels. Leave empty to show
45+
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
46+
confidence=
47+
48+
# Enable the message, report, category or checker with the given id(s). You can
49+
# either give multiple identifier separated by comma (,) or put this option
50+
# multiple time. See also the "--disable" option for examples.
51+
#enable=
52+
53+
# Disable the message, report, category or checker with the given id(s). You
54+
# can either give multiple identifiers separated by comma (,) or put this
55+
# option multiple times (only on the command line, not in the configuration
56+
# file where it should appear only once).You can also use "--disable=all" to
57+
# disable everything first and then reenable specific checks. For example, if
58+
# you want to run only the similarities checker, you can use "--disable=all
59+
# --enable=similarities". If you want to run only the classes checker, but have
60+
# no Warning level messages displayed, use"--disable=all --enable=classes
61+
# --disable=W"
62+
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating
63+
64+
65+
[REPORTS]
66+
67+
# Set the output format. Available formats are text, parseable, colorized, msvs
68+
# (visual studio) and html. You can also give a reporter class, eg
69+
# mypackage.mymodule.MyReporterClass.
70+
output-format=text
71+
72+
# Put messages in a separate file for each module / package specified on the
73+
# command line instead of printing them on stdout. Reports (if any) will be
74+
# written in a file name "pylint_global.[txt|html]".
75+
files-output=no
76+
77+
# Tells whether to display a full report or only the messages
78+
reports=yes
79+
80+
# Python expression which should return a note less than 10 (10 is the highest
81+
# note). You have access to the variables errors warning, statement which
82+
# respectively contain the number of errors / warnings messages and the total
83+
# number of statements analyzed. This is used by the global evaluation report
84+
# (RP0004).
85+
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
86+
87+
# Template used to display messages. This is a python new-style format string
88+
# used to format the message information. See doc for all details
89+
#msg-template=
90+
91+
92+
[SPELLING]
93+
94+
# Spelling dictionary name. Available dictionaries: none. To make it working
95+
# install python-enchant package.
96+
spelling-dict=
97+
98+
# List of comma separated words that should not be checked.
99+
spelling-ignore-words=
100+
101+
# A path to a file that contains private dictionary; one word per line.
102+
spelling-private-dict-file=
103+
104+
# Tells whether to store unknown words to indicated private dictionary in
105+
# --spelling-private-dict-file option instead of raising a message.
106+
spelling-store-unknown-words=no
107+
108+
109+
[MISCELLANEOUS]
110+
111+
# List of note tags to take in consideration, separated by a comma.
112+
notes=FIXME,XXX,TODO
113+
114+
115+
[VARIABLES]
116+
117+
# Tells whether we should check for unused import in __init__ files.
118+
init-import=yes
119+
120+
# A regular expression matching the name of dummy variables (i.e. expectedly
121+
# not used).
122+
dummy-variables-rgx=_$|dummy
123+
124+
# List of additional names supposed to be defined in builtins. Remember that
125+
# you should avoid to define new builtins when possible.
126+
additional-builtins=
127+
128+
# List of strings which can identify a callback function by name. A callback
129+
# name must start or end with one of those strings.
130+
callbacks=cb_,_cb
131+
132+
133+
[FORMAT]
134+
135+
# Maximum number of characters on a single line.
136+
max-line-length=99
137+
138+
# Regexp for a line that is allowed to be longer than the limit.
139+
#ignore-long-lines=^\s*(# )?<?https?://\S+>?$
140+
141+
# Allow the body of an if to be on the same line as the test if there is no
142+
# else.
143+
single-line-if-stmt=no
144+
145+
# List of optional constructs for which whitespace checking is disabled. `dict-
146+
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
147+
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
148+
# `empty-line` allows space-only lines.
149+
#no-space-check=trailing-comma,dict-separator
150+
151+
# Maximum number of lines in a module
152+
max-module-lines=1000
153+
154+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
155+
# tab).
156+
indent-string=' '
157+
158+
# Number of spaces of indent required inside a hanging or continued line.
159+
indent-after-paren=4
160+
161+
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
162+
expected-line-ending-format=
163+
164+
165+
[TYPECHECK]
166+
167+
# Tells whether missing members accessed in mixin class should be ignored. A
168+
# mixin class is detected if its name ends with "mixin" (case insensitive).
169+
ignore-mixin-members=yes
170+
171+
# List of module names for which member attributes should not be checked
172+
# (useful for modules/projects where namespaces are manipulated during runtime
173+
# and thus existing member attributes cannot be deduced by static analysis. It
174+
# supports qualified module names, as well as Unix pattern matching.
175+
ignored-modules=
176+
177+
# List of classes names for which member attributes should not be checked
178+
# (useful for classes with attributes dynamically set). This supports can work
179+
# with qualified names.
180+
ignored-classes=
181+
182+
# List of members which are set dynamically and missed by pylint inference
183+
# system, and so shouldn't trigger E1101 when accessed. Python regular
184+
# expressions are accepted.
185+
generated-members=
186+
187+
188+
[LOGGING]
189+
190+
# Logging modules to check that the string format arguments are in logging
191+
# function parameter format
192+
logging-modules=logging
193+
194+
195+
[SIMILARITIES]
196+
197+
# Minimum lines number of a similarity.
198+
min-similarity-lines=4
199+
200+
# Ignore comments when computing similarities.
201+
ignore-comments=yes
202+
203+
# Ignore docstrings when computing similarities.
204+
ignore-docstrings=yes
205+
206+
# Ignore imports when computing similarities.
207+
ignore-imports=no
208+
209+
210+
[BASIC]
211+
212+
# List of builtins function names that should not be used, separated by a comma
213+
bad-functions=map,filter,input
214+
215+
# Good variable names which should always be accepted, separated by a comma
216+
good-names=_
217+
218+
# Bad variable names which should always be refused, separated by a comma
219+
bad-names=foo,bar,baz,toto,tutu,tata
220+
221+
# Colon-delimited sets of names that determine each other's naming style when
222+
# the name regexes allow several styles.
223+
name-group=
224+
225+
# Include a hint for the correct naming format with invalid-name
226+
include-naming-hint=yes
227+
228+
# Regular expression matching correct function names
229+
function-rgx=[a-z_][a-z0-9_]{2,30}$
230+
231+
# Naming hint for function names
232+
function-name-hint=[a-z_][a-z0-9_]{2,30}$
233+
234+
# Regular expression matching correct variable names
235+
variable-rgx=[a-z_][a-z0-9_]{2,30}$
236+
237+
# Naming hint for variable names
238+
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
239+
240+
# Regular expression matching correct constant names
241+
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
242+
243+
# Naming hint for constant names
244+
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
245+
246+
# Regular expression matching correct attribute names
247+
attr-rgx=[a-z_][a-z0-9_]{2,30}$
248+
249+
# Naming hint for attribute names
250+
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
251+
252+
# Regular expression matching correct argument names
253+
argument-rgx=[a-z_][a-z0-9_]{2,30}$
254+
255+
# Naming hint for argument names
256+
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
257+
258+
# Regular expression matching correct class attribute names
259+
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
260+
261+
# Naming hint for class attribute names
262+
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
263+
264+
# Regular expression matching correct inline iteration names
265+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
266+
267+
# Naming hint for inline iteration names
268+
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
269+
270+
# Regular expression matching correct class names
271+
class-rgx=[A-Z_][a-zA-Z0-9]+$
272+
273+
# Naming hint for class names
274+
class-name-hint=[A-Z_][a-zA-Z0-9]+$
275+
276+
# Regular expression matching correct module names
277+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
278+
279+
# Naming hint for module names
280+
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
281+
282+
# Regular expression matching correct method names
283+
method-rgx=[a-z_][a-z0-9_]{2,30}$
284+
285+
# Naming hint for method names
286+
method-name-hint=[a-z_][a-z0-9_]{2,30}$
287+
288+
# Regular expression which should only match function or class names that do
289+
# not require a docstring.
290+
no-docstring-rgx=^_
291+
292+
# Minimum line length for functions/classes that require docstrings, shorter
293+
# ones are exempt.
294+
docstring-min-length=-1
295+
296+
297+
[ELIF]
298+
299+
# Maximum number of nested blocks for function / method body
300+
max-nested-blocks=5
301+
302+
303+
[IMPORTS]
304+
305+
# Deprecated modules which should not be used, separated by a comma
306+
deprecated-modules=regsub,TERMIOS,Bastion,rexec
307+
308+
# Create a graph of every (i.e. internal and external) dependencies in the
309+
# given file (report RP0402 must not be disabled)
310+
import-graph=
311+
312+
# Create a graph of external dependencies in the given file (report RP0402 must
313+
# not be disabled)
314+
ext-import-graph=
315+
316+
# Create a graph of internal dependencies in the given file (report RP0402 must
317+
# not be disabled)
318+
int-import-graph=
319+
320+
321+
[DESIGN]
322+
323+
# Maximum number of arguments for function / method
324+
max-args=5
325+
326+
# Argument names that match this expression will be ignored. Default to name
327+
# with leading underscore
328+
ignored-argument-names=_.*
329+
330+
# Maximum number of locals for function / method body
331+
max-locals=15
332+
333+
# Maximum number of return / yield for function / method body
334+
max-returns=6
335+
336+
# Maximum number of branch for function / method body
337+
max-branches=12
338+
339+
# Maximum number of statements in function / method body
340+
max-statements=50
341+
342+
# Maximum number of parents for a class (see R0901).
343+
max-parents=7
344+
345+
# Maximum number of attributes for a class (see R0902).
346+
max-attributes=7
347+
348+
# Minimum number of public methods for a class (see R0903).
349+
min-public-methods=2
350+
351+
# Maximum number of public methods for a class (see R0904).
352+
max-public-methods=20
353+
354+
# Maximum number of boolean expressions in a if statement
355+
max-bool-expr=5
356+
357+
358+
[CLASSES]
359+
360+
# List of method names used to declare (i.e. assign) instance attributes.
361+
defining-attr-methods=__init__,__new__,setUp
362+
363+
# List of valid names for the first argument in a class method.
364+
valid-classmethod-first-arg=cls
365+
366+
# List of valid names for the first argument in a metaclass class method.
367+
valid-metaclass-classmethod-first-arg=mcs
368+
369+
# List of member names, which should be excluded from the protected access
370+
# warning.
371+
exclude-protected=_asdict,_fields,_replace,_source,_make
372+
373+
374+
[EXCEPTIONS]
375+
376+
# Exceptions that will emit a warning when being caught. Defaults to
377+
# "Exception"
378+
overgeneral-exceptions=Exception

‎wifiphisher/constants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python2
22
# -*- coding: utf-8 -*-
3-
3+
#pylint: skip-file
44
import os
55

66
dir_of_executable = os.path.dirname(__file__)

‎wifiphisher/firewall.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pylint: skip-file
12
import subprocess
23
from constants import *
34

@@ -15,7 +16,7 @@ def nat(self, internal_interface, external_interface):
1516
subprocess.call(
1617
('iptables -A FORWARD -i %s -o %s -j ACCEPT'
1718
% (internal_interface, external_interface)),
18-
shell=True)
19+
shell=True)
1920

2021
def clear_rules(self):
2122
subprocess.call('iptables -F', shell=True)

‎wifiphisher/interfaces.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pylint: skip-file
12
"""
23
This module was made to handle all the interface related operations for
34
Wifiphisher.py
@@ -193,7 +194,7 @@ def has_monitor_mode(self):
193194
def set_channel(self, channel):
194195
"""
195196
Set the device channel to the provided channel.
196-
197+
197198
:param self: A NetworkAdapter object
198199
:param channel: A channel number
199200
:type self: NetworkAdapter

‎wifiphisher/macmatcher.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pylint: skip-file
12
"""
23
This module was made to match MAC address with vendors
34
"""

‎wifiphisher/phishinghttp.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pylint: skip-file
12
import tornado.ioloop
23
import tornado.web
34
import logging
@@ -9,7 +10,7 @@
910

1011
template = False
1112
terminate = False
12-
creds = []
13+
creds = []
1314

1415

1516
class DowngradeToHTTP(tornado.web.RequestHandler):

‎wifiphisher/phishingpage.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pylint: skip-file
12
"""
23
This module handles all the phishing related operations for
34
Wifiphisher.py
@@ -109,7 +110,7 @@ def get_payload_path(self):
109110
110111
:param self: A PhishingTemplate object
111112
:type self: PhishingTemplate
112-
:return: The path of the template
113+
:return: The path of the template
113114
:rtype: bool
114115
"""
115116

@@ -121,7 +122,7 @@ def has_payload(self):
121122
122123
:param self: A PhishingTemplate object
123124
:type self: PhishingTemplate
124-
:return: boolean if it needs payload
125+
:return: boolean if it needs payload
125126
:rtype: bool
126127
"""
127128

@@ -168,7 +169,7 @@ def get_path_static(self):
168169

169170
def use_file(self, path):
170171
"""
171-
Copies a file in the filesystem to the path
172+
Copies a file in the filesystem to the path
172173
of the template files.
173174
174175
:param self: A PhishingTemplate object

‎wifiphisher/pywifiphisher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python2
22
# -*- coding: utf-8 -*-
3-
3+
#pylint: skip-file
44
import subprocess
55
import os
66
import string

0 commit comments

Comments
 (0)
Please sign in to comment.