Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d6b187d1
Commit
d6b187d1
authored
Jul 01, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update pylint to 1.4.0
parent
4a37648f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
115 deletions
+140
-115
pavelib/quality.py
+5
-2
pylintrc
+133
-111
requirements/edx/base.txt
+1
-1
scripts/all-tests.sh
+1
-1
No files found.
pavelib/quality.py
View file @
d6b187d1
...
@@ -42,8 +42,10 @@ def find_fixme(options):
...
@@ -42,8 +42,10 @@ def find_fixme(options):
sh
(
sh
(
"{pythonpath_prefix} pylint --disable R,C,W,E --enable=fixme "
"{pythonpath_prefix} pylint --disable R,C,W,E --enable=fixme "
"-f parseable {apps} | tee {report_dir}/pylint_fixme.report"
.
format
(
"--msg-template={msg_template} {apps} "
"| tee {report_dir}/pylint_fixme.report"
.
format
(
pythonpath_prefix
=
pythonpath_prefix
,
pythonpath_prefix
=
pythonpath_prefix
,
msg_template
=
'"{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"'
,
apps
=
apps_list
,
apps
=
apps_list
,
report_dir
=
report_dir
report_dir
=
report_dir
)
)
...
@@ -97,10 +99,11 @@ def run_pylint(options):
...
@@ -97,10 +99,11 @@ def run_pylint(options):
)
)
sh
(
sh
(
"{pythonpath_prefix} pylint {flags} -
f parseable
{apps} | "
"{pythonpath_prefix} pylint {flags} -
-msg-template={msg_template}
{apps} | "
"tee {report_dir}/pylint.report"
.
format
(
"tee {report_dir}/pylint.report"
.
format
(
pythonpath_prefix
=
pythonpath_prefix
,
pythonpath_prefix
=
pythonpath_prefix
,
flags
=
" "
.
join
(
flags
),
flags
=
" "
.
join
(
flags
),
msg_template
=
'"{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"'
,
apps
=
apps_list
,
apps
=
apps_list
,
report_dir
=
report_dir
report_dir
=
report_dir
)
)
...
...
pylintrc
View file @
d6b187d1
...
@@ -26,53 +26,46 @@ load-plugins=
...
@@ -26,53 +26,46 @@ load-plugins=
# Enable the message, report, category or checker with the given id(s). You can
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
# multiple time.
See also the "--disable" option for examples.
#enable=
#enable=
# Disable the message, report, category or checker with the given id(s). You
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# can either give multiple identifiers separated by comma (,) or put this
# multiple time (only on the command line, not in the configuration file where
# option multiple times (only on the command line, not in the configuration
# it should appear only once).
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=
disable=
# Never going to use these
locally-disabled,
# I0011: Locally disabling W0232
too-few-public-methods,
# C0301: Line too long
bad-builtin,
# W0141: Used builtin function 'map'
star-args,
# W0142: Used * or ** magic
abstract-class-not-used,
# R0921: Abstract class not referenced
abstract-class-little-used,
# R0922: Abstract class is only referenced 1 times
no-init,
I0011,C0301,W0141,W0142,R0921,R0922,
fixme,
too-many-lines,
# Django makes classes that trigger these
no-self-use,
# W0232: Class has no __init__ method
too-many-ancestors,
W0232,
too-many-instance-attributes,
too-few-public-methods,
# Disable 'fixme' so that quality builds don't fail due to them
too-many-public-methods,
W0511,
too-many-return-statements,
too-many-branches,
# Might use these when the code is in better shape
too-many-arguments,
# C0302: Too many lines in module
too-many-locals
# R0201: Method could be a function
# R0901: Too many ancestors
# R0902: Too many instance attributes
# R0903: Too few public methods (1/2)
# R0904: Too many public methods
# R0911: Too many return statements
# R0912: Too many branches
# R0913: Too many arguments
# R0914: Too many local variables
C0302,R0201,R0901,R0902,R0903,R0904,R0911,R0912,R0913,R0914
[REPORTS]
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text
output-format=text
# Include message's id in output
include-ids=yes
# Put messages in a separate file for each module / package specified on the
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
# written in a file name "pylint_global.[txt|html]".
...
@@ -92,53 +85,11 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme
...
@@ -92,53 +85,11 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme
# evaluation report (RP0004).
# evaluation report (RP0004).
comment=no
comment=no
# Display symbolic names of messages in reports
symbols=yes
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
#
When zope mode is activated, add a predefined set of Zope acquired attributes
#
Template used to display messages. This is a python new-style format string
#
to generated-members.
#
used to format the message information. See doc for all details
zope=no
#msg-template=
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=
REQUEST,
acl_users,
aq_parent,
objects,
DoesNotExist,
can_read,
can_write,
get_url,
size,
content,
status_code,
# For factory_boy factories
create,
build,
# For xblocks
fields,
# For locations
tag,
org,
course,
category,
name,
revision,
# For django models
_meta,
[BASIC]
[BASIC]
...
@@ -158,10 +109,12 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$
...
@@ -158,10 +109,12 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$
class-rgx=[A-Z_][a-zA-Z0-9]+$
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
# Regular expression which should only match correct function names
# Normally limited to 30 chars, but test names can be as long as they want
function-rgx=([a-z_][a-z0-9_]{2,30}|test_[a-z0-9_]+)$
function-rgx=([a-z_][a-z0-9_]{2,30}|test_[a-z0-9_]+)$
# Regular expression which should only match correct method names
# Regular expression which should only match correct method names
method-rgx=([a-z_][a-z0-9_]{2,60}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$
# Normally, should be all lower, but some exceptions for unittest methods
method-rgx=([a-z_][a-z0-9_]{2,40}|setUp|set[Uu]pClass|tearDown|tear[Dd]ownClass|assert[A-Z]\w*|maxDiff|test_[a-z0-9_]+)$
# Regular expression which should only match correct instance attribute names
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
attr-rgx=[a-z_][a-z0-9_]{2,30}$
...
@@ -172,6 +125,10 @@ argument-rgx=[a-z_][a-z0-9_]{2,30}$
...
@@ -172,6 +125,10 @@ argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression which should only match correct list comprehension /
# Regular expression which should only match correct list comprehension /
# generator expression variable names
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
...
@@ -182,15 +139,13 @@ good-names=f,i,j,k,db,ex,Run,_,__
...
@@ -182,15 +139,13 @@ good-names=f,i,j,k,db,ex,Run,_,__
# Bad variable names which should always be refused, separated by a comma
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match function
s or classes name which
do
# Regular expression which should only match function
or class names that
do
# not require a docstring
# not require a docstring
.
no-docstring-rgx=__.*__|test_.
*
|setUp|tearDown
no-docstring-rgx=__.*__|test_.
+
|setUp|tearDown
# Minimum line length for functions/classes that require docstrings, shorter
[MISCELLANEOUS]
# ones are exempt.
docstring-min-length=-1
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[FORMAT]
[FORMAT]
...
@@ -198,6 +153,16 @@ notes=FIXME,XXX,TODO
...
@@ -198,6 +153,16 @@ notes=FIXME,XXX,TODO
# Maximum number of characters on a single line.
# Maximum number of characters on a single line.
max-line-length=120
max-line-length=120
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
# Maximum number of lines in a module
max-module-lines=1000
max-module-lines=1000
...
@@ -206,6 +171,12 @@ max-module-lines=1000
...
@@ -206,6 +171,12 @@ max-module-lines=1000
indent-string=' '
indent-string=' '
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
[SIMILARITIES]
# Minimum lines number of a similarity.
# Minimum lines number of a similarity.
...
@@ -217,6 +188,54 @@ ignore-comments=yes
...
@@ -217,6 +188,54 @@ ignore-comments=yes
# Ignore docstrings when computing similarities.
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=
REQUEST,
acl_users,
aq_parent,
objects,
DoesNotExist,
can_read,
can_write,
get_url,
size,
content,
status_code,
# For factory_boy factories
create,
build,
# For xblocks
fields,
# For locations
tag,
org,
course,
category,
name,
revision,
# For django models
_meta,
[VARIABLES]
[VARIABLES]
...
@@ -232,22 +251,20 @@ dummy-variables-rgx=_|dummy|unused|.*_unused
...
@@ -232,22 +251,20 @@ dummy-variables-rgx=_|dummy|unused|.*_unused
additional-builtins=
additional-builtins=
[
IMPORT
S]
[
CLASSE
S]
# Deprecated modules which should not be used, separated by a comma
# List of interface methods to ignore, separated by a comma. This is used for
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec,track.views
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# Create a graph of every (i.e. internal and external) dependencies in the
# List of method names used to declare (i.e. assign) instance attributes.
# given file (report RP0402 must not be disabled)
defining-attr-methods=__init__,__new__,setUp
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# List of valid names for the first argument in a class method.
# not be disabled)
valid-classmethod-first-arg=cls
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# List of valid names for the first argument in a metaclass class method.
# not be disabled)
valid-metaclass-classmethod-first-arg=mcs
int-import-graph=
[DESIGN]
[DESIGN]
...
@@ -266,7 +283,7 @@ max-locals=15
...
@@ -266,7 +283,7 @@ max-locals=15
max-returns=6
max-returns=6
# Maximum number of branch for function / method body
# Maximum number of branch for function / method body
max-branchs=12
max-branch
e
s=12
# Maximum number of statements in function / method body
# Maximum number of statements in function / method body
max-statements=50
max-statements=50
...
@@ -284,17 +301,22 @@ min-public-methods=2
...
@@ -284,17 +301,22 @@ min-public-methods=2
max-public-methods=20
max-public-methods=20
[
CLASSE
S]
[
IMPORT
S]
# List of interface methods to ignore, separated by a comma. This is used for
# Deprecated modules which should not be used, separated by a comma
# instance to not check methods defines in Zope's Interface base class.
deprecated-modules=regsub,TERMIOS,Bastion,rexec
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
# Create a graph of every (i.e. internal and external) dependencies in the
defining-attr-methods=__init__,__new__,setUp
# given file (report RP0402 must not be disabled)
import-graph=
# List of valid names for the first argument in a class method.
# Create a graph of external dependencies in the given file (report RP0402 must
valid-classmethod-first-arg=cls
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[EXCEPTIONS]
[EXCEPTIONS]
...
...
requirements/edx/base.txt
View file @
d6b187d1
...
@@ -129,7 +129,7 @@ nose-exclude
...
@@ -129,7 +129,7 @@ nose-exclude
nose-ignore-docstring
nose-ignore-docstring
nosexcover==1.0.7
nosexcover==1.0.7
pep8==1.5.7
pep8==1.5.7
pylint==
0.28
pylint==
1.4.0
python-subunit==0.0.16
python-subunit==0.0.16
rednose==0.3
rednose==0.3
selenium==2.42.1
selenium==2.42.1
...
...
scripts/all-tests.sh
View file @
d6b187d1
...
@@ -56,7 +56,7 @@ set -e
...
@@ -56,7 +56,7 @@ set -e
###############################################################################
###############################################################################
# Violations thresholds for failing the build
# Violations thresholds for failing the build
PYLINT_THRESHOLD
=
46
00
PYLINT_THRESHOLD
=
58
00
PEP8_THRESHOLD
=
0
PEP8_THRESHOLD
=
0
source
$HOME
/jenkins_env
source
$HOME
/jenkins_env
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment