Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
b4fe3474
Commit
b4fe3474
authored
6 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Fix/ignore errors caused by a pycodestyle upgrade
parent
be457619
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/xsslint/tests/test_main.py
+19
-19
19 additions, 19 deletions
scripts/xsslint/tests/test_main.py
setup.cfg
+2
-2
2 additions, 2 deletions
setup.cfg
with
21 additions
and
21 deletions
scripts/xsslint/tests/test_main.py
+
19
−
19
View file @
b4fe3474
...
...
@@ -76,24 +76,24 @@ class TestXSSLinter(TestCase):
output
=
self
.
out
.
getvalue
()
# Assert violation details are displayed.
self
.
assertIsNotNone
(
re
.
search
(
'
test\.html.*{}
'
.
format
(
self
.
ruleset
.
mako_missing_default
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
'
test\.js.*{}
'
.
format
(
self
.
ruleset
.
javascript_concat_html
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
'
test\.js.*{}
'
.
format
(
self
.
ruleset
.
underscore_not_escaped
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.html.*{}
'
.
format
(
self
.
ruleset
.
mako_missing_default
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.js.*{}
'
.
format
(
self
.
ruleset
.
javascript_concat_html
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.js.*{}
'
.
format
(
self
.
ruleset
.
underscore_not_escaped
.
rule_id
),
output
))
lines_with_rule
=
0
lines_without_rule
=
0
# Output with verbose setting only.
for
underscore_match
in
re
.
finditer
(
'
test\.underscore:.*
\n
'
,
output
):
for
underscore_match
in
re
.
finditer
(
r
'
test\.underscore:.*\n
'
,
output
):
if
re
.
search
(
self
.
ruleset
.
underscore_not_escaped
.
rule_id
,
underscore_match
.
group
())
is
not
None
:
lines_with_rule
+=
1
else
:
lines_without_rule
+=
1
self
.
assertGreaterEqual
(
lines_with_rule
,
1
)
self
.
assertEquals
(
lines_without_rule
,
0
)
self
.
assertIsNone
(
re
.
search
(
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
# Assert no rule totals.
self
.
assertIsNone
(
re
.
search
(
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
# Assert final total
self
.
assertIsNotNone
(
re
.
search
(
'
{} violations total
'
.
format
(
7
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
{} violations total
'
.
format
(
7
),
output
))
def
test_lint_with_verbose
(
self
):
"""
...
...
@@ -115,7 +115,7 @@ class TestXSSLinter(TestCase):
output
=
self
.
out
.
getvalue
()
lines_with_rule
=
0
lines_without_rule
=
0
# Output with verbose setting only.
for
underscore_match
in
re
.
finditer
(
'
test\.underscore:.*
\n
'
,
output
):
for
underscore_match
in
re
.
finditer
(
r
'
test\.underscore:.*\n
'
,
output
):
if
re
.
search
(
self
.
ruleset
.
underscore_not_escaped
.
rule_id
,
underscore_match
.
group
())
is
not
None
:
lines_with_rule
+=
1
else
:
...
...
@@ -123,9 +123,9 @@ class TestXSSLinter(TestCase):
self
.
assertGreaterEqual
(
lines_with_rule
,
1
)
self
.
assertGreaterEqual
(
lines_without_rule
,
1
)
# Assert no rule totals.
self
.
assertIsNone
(
re
.
search
(
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
# Assert final total
self
.
assertIsNotNone
(
re
.
search
(
'
{} violations total
'
.
format
(
7
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
{} violations total
'
.
format
(
7
),
output
))
def
test_lint_with_rule_totals
(
self
):
"""
...
...
@@ -145,12 +145,12 @@ class TestXSSLinter(TestCase):
)
output
=
self
.
out
.
getvalue
()
self
.
assertIsNotNone
(
re
.
search
(
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
# Assert totals output.
self
.
assertIsNotNone
(
re
.
search
(
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
,
1
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
'
{} violations total
'
.
format
(
7
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
,
1
),
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
{} violations total
'
.
format
(
7
),
output
))
def
test_lint_with_list_files
(
self
):
"""
...
...
@@ -171,10 +171,10 @@ class TestXSSLinter(TestCase):
output
=
self
.
out
.
getvalue
()
# Assert file with rule is not output.
self
.
assertIsNone
(
re
.
search
(
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
test\.py.*{}
'
.
format
(
self
.
ruleset
.
python_wrap_html
.
rule_id
),
output
))
# Assert file is output.
self
.
assertIsNotNone
(
re
.
search
(
'
test\.py
'
,
output
))
self
.
assertIsNotNone
(
re
.
search
(
r
'
test\.py
'
,
output
))
# Assert no totals.
self
.
assertIsNone
(
re
.
search
(
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNone
(
re
.
search
(
'
{} violations total
'
.
format
(
7
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
{}:\s*{} violations
'
.
format
(
self
.
ruleset
.
python_parse_error
.
rule_id
,
0
),
output
))
self
.
assertIsNone
(
re
.
search
(
r
'
{} violations total
'
.
format
(
7
),
output
))
This diff is collapsed.
Click to expand it.
setup.cfg
+
2
−
2
View file @
b4fe3474
...
...
@@ -28,9 +28,9 @@ python_files = tests.py test_*.py tests_*.py *_tests.py __init__.py
# http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html
# It's
a little unusual, but we have good reasons for doing so, so we disable
# this
rule.
# E305,E402,E722,E731,E741,E743,W503:
errors and warnings added since pep8/pyco
dest
yle
# E305,E402,E722,E731,E741,E743,W503
,W504
:
errors and warnings added since pep8/pyco
dest
yle
# 1.5.7
that we haven't cleaned up yet
ignore=E265,E266,E305,E402,E501,E722,E731,E741,E743,W503,W602
ignore=E265,E266,E305,E402,E501,E722,E731,E741,E743,W503,
W504,
W602
exclude=migrations,.git,.pycharm_helpers,.tox,test_root/staticfiles,node_modules
[isort]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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