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
c7df9480
Commit
c7df9480
authored
Jul 03, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run pep8 and pylint per environment
parent
77fea777
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
20 deletions
+27
-20
rakefile
+27
-20
No files found.
rakefile
View file @
c7df9480
...
...
@@ -42,21 +42,6 @@ end
task
:default
=>
[
:test
,
:pep8
,
:pylint
]
directory
REPORT_DIR
directory
LMS_REPORT_DIR
desc
"Run pep8 on all libraries"
task
:pep8
=>
REPORT_DIR
do
sh
(
"pep8 --ignore=E501 lms/djangoapps common/lib/* | tee
#{
REPORT_DIR
}
/pep8.report"
)
end
desc
"Run pylint on all libraries"
task
:pylint
=>
REPORT_DIR
do
Dir
[
"lms/djangoapps/*"
,
"common/lib/*"
].
each
do
|
app
|
ENV
[
'PYTHONPATH'
]
=
File
.
dirname
(
app
)
app
=
File
.
basename
(
app
)
sh
(
"pylint --rcfile=.pylintrc -f parseable
#{
app
}
| tee
#{
REPORT_DIR
}
/
#{
app
}
.pylint.report"
)
end
end
default_options
=
{
:lms
=>
'8000'
,
...
...
@@ -68,18 +53,39 @@ task :predjango do
sh
(
'pip install -e common/lib/xmodule'
)
end
[
:lms
,
:cms
,
:common
].
each
do
|
system
|
report_dir
=
File
.
join
(
REPORT_DIR
,
system
.
to_s
)
directory
report_dir
desc
"Run pep8 on all
#{
system
}
code"
task
"pep8_
#{
system
}
"
=>
report_dir
do
sh
(
"pep8 --ignore=E501
#{
system
}
/djangoapps
#{
system
}
/lib | tee
#{
report_dir
}
/pep8.report"
)
end
task
:pep8
=>
"pep8_
#{
system
}
"
desc
"Run pylint on all
#{
system
}
code"
task
"pylint_
#{
system
}
"
=>
report_dir
do
Dir
[
"
#{
system
}
/djangoapps/*"
,
"
#{
system
}
/lib/*"
].
each
do
|
app
|
ENV
[
'PYTHONPATH'
]
=
File
.
dirname
(
app
)
app
=
File
.
basename
(
app
)
sh
(
"pylint --rcfile=.pylintrc -f parseable
#{
app
}
| tee
#{
report_dir
}
/
#{
app
}
.pylint.report"
)
end
end
task
:pylint
=>
"pylint_
#{
system
}
"
end
[
:lms
,
:cms
].
each
do
|
system
|
task_name
=
"test_
#{
system
}
"
report_dir
=
File
.
join
(
REPORT_DIR
,
task_name
)
report_dir
=
File
.
join
(
REPORT_DIR
,
system
.
to_s
)
directory
report_dir
# Per System tasks
desc
"Run all django tests on our djangoapps for the
#{
system
}
"
task
task_name
=>
[
report_dir
,
:predjango
]
do
task
"test_
#{
system
}
"
=>
[
report_dir
,
:predjango
]
do
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
ENV
[
'NOSE_COVER_HTML_DIR'
]
=
File
.
join
(
report_dir
,
"cover"
)
sh
(
django_admin
(
system
,
:test
,
'test'
,
*
Dir
[
"
#{
system
}
/djangoapps/*"
].
each
))
end
task
:test
=>
task_name
task
:test
=>
"test_
#{
system
}
"
desc
<<-
desc
Start the
#{
system
}
locally with the specified environment (defaults to dev).
...
...
@@ -89,7 +95,8 @@ end
args
.
with_defaults
(
:env
=>
'dev'
,
:options
=>
default_options
[
system
])
sh
(
django_admin
(
system
,
args
.
env
,
'runserver'
,
args
.
options
))
end
# Per environment tasks
Dir
[
"
#{
system
}
/envs/*.py"
].
each
do
|
env_file
|
env
=
File
.
basename
(
env_file
).
gsub
(
/\.py/
,
''
)
desc
"Attempt to import the settings file
#{
system
}
.envs.
#{
env
}
and report any errors"
...
...
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