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
Show 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):
sh
(
"{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
,
msg_template
=
'"{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"'
,
apps
=
apps_list
,
report_dir
=
report_dir
)
...
...
@@ -97,10 +99,11 @@ def run_pylint(options):
)
sh
(
"{pythonpath_prefix} pylint {flags} -
f parseable
{apps} | "
"{pythonpath_prefix} pylint {flags} -
-msg-template={msg_template}
{apps} | "
"tee {report_dir}/pylint.report"
.
format
(
pythonpath_prefix
=
pythonpath_prefix
,
flags
=
" "
.
join
(
flags
),
msg_template
=
'"{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}"'
,
apps
=
apps_list
,
report_dir
=
report_dir
)
...
...
pylintrc
View file @
d6b187d1
...
...
@@ -26,53 +26,46 @@ load-plugins=
# 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
# multiple time.
# multiple time.
See also the "--disable" option for examples.
#enable=
# 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
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# 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=
# Never going to use these
# I0011: Locally disabling W0232
# C0301: Line too long
# W0141: Used builtin function 'map'
# W0142: Used * or ** magic
# R0921: Abstract class not referenced
# R0922: Abstract class is only referenced 1 times
I0011,C0301,W0141,W0142,R0921,R0922,
# Django makes classes that trigger these
# W0232: Class has no __init__ method
W0232,
# Disable 'fixme' so that quality builds don't fail due to them
W0511,
# Might use these when the code is in better shape
# C0302: Too many lines in module
# 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
locally-disabled,
too-few-public-methods,
bad-builtin,
star-args,
abstract-class-not-used,
abstract-class-little-used,
no-init,
fixme,
too-many-lines,
no-self-use,
too-many-ancestors,
too-many-instance-attributes,
too-few-public-methods,
too-many-public-methods,
too-many-return-statements,
too-many-branches,
too-many-arguments,
too-many-locals
[REPORTS]
# 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
# Include message's id in output
include-ids=yes
# 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
# written in a file name "pylint_global.[txt|html]".
...
...
@@ -92,53 +85,11 @@ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / stateme
# evaluation report (RP0004).
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
#
to generated-members.
zope=no
#
Template used to display messages. This is a python new-style format string
#
used to format the message information. See doc for all details
#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]
...
...
@@ -158,10 +109,12 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|log|urlpatterns)$
class-rgx=[A-Z_][a-zA-Z0-9]+$
# 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_]+)$
# 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
attr-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
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 /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
...
...
@@ -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-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match function
s or classes name which
do
# not require a docstring
no-docstring-rgx=__.*__|test_.
*
|setUp|tearDown
# Regular expression which should only match function
or class names that
do
# not require a docstring
.
no-docstring-rgx=__.*__|test_.
+
|setUp|tearDown
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[FORMAT]
...
...
@@ -198,6 +153,16 @@ notes=FIXME,XXX,TODO
# Maximum number of characters on a single line.
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
max-module-lines=1000
...
...
@@ -206,6 +171,12 @@ max-module-lines=1000
indent-string=' '
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
# Minimum lines number of a similarity.
...
...
@@ -217,6 +188,54 @@ ignore-comments=yes
# Ignore docstrings when computing similarities.
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]
...
...
@@ -232,22 +251,20 @@ dummy-variables-rgx=_|dummy|unused|.*_unused
additional-builtins=
[
IMPORT
S]
[
CLASSE
S]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec,track.views
# List of interface methods to ignore, separated by a comma. This is used for
# 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
# given file (report RP0402 must not be disabled)
import-graph=
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
...
...
@@ -266,7 +283,7 @@ max-locals=15
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
max-branch
e
s=12
# Maximum number of statements in function / method body
max-statements=50
...
...
@@ -284,17 +301,22 @@ min-public-methods=2
max-public-methods=20
[
CLASSE
S]
[
IMPORT
S]
# List of interface methods to ignore, separated by a comma. This is used for
# 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
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# Create a graph of external dependencies in the given file (report RP0402 must
# 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]
...
...
requirements/edx/base.txt
View file @
d6b187d1
...
...
@@ -129,7 +129,7 @@ nose-exclude
nose-ignore-docstring
nosexcover==1.0.7
pep8==1.5.7
pylint==
0.28
pylint==
1.4.0
python-subunit==0.0.16
rednose==0.3
selenium==2.42.1
...
...
scripts/all-tests.sh
View file @
d6b187d1
...
...
@@ -56,7 +56,7 @@ set -e
###############################################################################
# Violations thresholds for failing the build
PYLINT_THRESHOLD
=
46
00
PYLINT_THRESHOLD
=
58
00
PEP8_THRESHOLD
=
0
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