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
ca9f071d
Commit
ca9f071d
authored
Dec 08, 2014
by
Christine Lytwynec
Committed by
Zia Fazal
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add find_fixme task
parent
26dea81a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
pavelib/quality.py
+47
-0
scripts/all-tests.sh
+1
-0
No files found.
pavelib/quality.py
View file @
ca9f071d
...
...
@@ -12,6 +12,53 @@ from .utils.envs import Env
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
(
"system="
,
"s"
,
"System to act on"
),
])
def
find_fixme
(
options
):
"""
Run pylint on system code, only looking for fixme items.
"""
num_fixme
=
0
systems
=
getattr
(
options
,
'system'
,
'lms,cms,common'
)
.
split
(
','
)
for
system
in
systems
:
# Directory to put the pylint report in.
# This makes the folder if it doesn't already exist.
report_dir
=
(
Env
.
REPORT_DIR
/
system
)
.
makedirs_p
()
apps
=
[
system
]
for
directory
in
[
'djangoapps'
,
'lib'
]:
dirs
=
os
.
listdir
(
os
.
path
.
join
(
system
,
directory
))
apps
.
extend
([
d
for
d
in
dirs
if
os
.
path
.
isdir
(
os
.
path
.
join
(
system
,
directory
,
d
))])
apps_list
=
' '
.
join
(
apps
)
pythonpath_prefix
=
(
"PYTHONPATH={system}:{system}/djangoapps:{system}/"
"lib:common/djangoapps:common/lib"
.
format
(
system
=
system
)
)
sh
(
"{pythonpath_prefix} pylint --disable R,C,W,E --enable=fixme "
"-f parseable {apps} | tee {report_dir}/pylint_fixme.report"
.
format
(
pythonpath_prefix
=
pythonpath_prefix
,
apps
=
apps_list
,
report_dir
=
report_dir
)
)
num_fixme
+=
_count_pylint_violations
(
"{report_dir}/pylint_fixme.report"
.
format
(
report_dir
=
report_dir
))
print
(
"Number of pylint fixmes: "
+
str
(
num_fixme
))
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
(
"system="
,
"s"
,
"System to act on"
),
(
"errors"
,
"e"
,
"Check for errors only"
),
(
"limit="
,
"l"
,
"limit for number of acceptable violations"
),
])
...
...
scripts/all-tests.sh
View file @
ca9f071d
...
...
@@ -107,6 +107,7 @@ SHARD=${SHARD:="all"}
case
"
$TEST_SUITE
"
in
"quality"
)
paver find_fixme
>
fixme.log
||
{
cat
fixme.log
;
EXIT
=
1
;
}
paver run_pep8
-l
$PEP8_THRESHOLD
>
pep8.log
||
{
cat
pep8.log
;
EXIT
=
1
;
}
paver run_pylint
-l
$PYLINT_THRESHOLD
>
pylint.log
||
{
cat
pylint.log
;
EXIT
=
1
;
}
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
...
...
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