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
d2b1d535
Commit
d2b1d535
authored
Mar 17, 2016
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add help to the template linter
parent
eb42cb1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
scripts/safe_template_checker.py
+14
-2
No files found.
scripts/safe_template_checker.py
View file @
d2b1d535
...
...
@@ -171,7 +171,8 @@ class MakoTemplateChecker(object):
_skip_mako_dirs
=
_skip_dirs
_results
=
[]
def
__init__
(
self
):
self
.
_results
=
[]
def
process_file
(
self
,
directory
,
file_name
):
"""
...
...
@@ -399,7 +400,8 @@ class UnderscoreTemplateChecker(object):
_skip_underscore_dirs
=
_skip_dirs
_results
=
[]
def
__init__
(
self
):
self
.
_results
=
[]
def
process_file
(
self
,
directory
,
file_name
):
"""
...
...
@@ -481,6 +483,16 @@ def _process_os_walk(starting_dir, template_checkers):
def
main
():
#TODO: Use click
if
'--help'
in
sys
.
argv
:
print
"Check that templates are safe."
print
"Options:"
print
" --quiet Just display the filenames with violations."
print
print
"Rules:"
for
rule
in
Rules
.
__members__
.
values
():
print
" {0[0]}: {0[1]}"
.
format
(
rule
.
value
)
return
is_quiet
=
'--quiet'
in
sys
.
argv
options
=
{
...
...
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