Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
7f23c88d
Commit
7f23c88d
authored
10 years ago
by
Christine Lytwynec
Browse files
Options
Downloads
Patches
Plain Diff
add find_fixme task
parent
f561e79a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pavelib/quality.py
+47
-0
47 additions, 0 deletions
pavelib/quality.py
scripts/all-tests.sh
+1
-0
1 addition, 0 deletions
scripts/all-tests.sh
with
48 additions
and
0 deletions
pavelib/quality.py
+
47
−
0
View file @
7f23c88d
...
...
@@ -8,6 +8,53 @@ import re
from
.utils.envs
import
Env
@task
@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
([
...
...
This diff is collapsed.
Click to expand it.
scripts/all-tests.sh
+
1
−
0
View file @
7f23c88d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment