Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
apb7 committed Feb 17, 2018
1 parent 87b71c9 commit 54bb35f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
display: inline-block;
margin-bottom: 0;
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h4>
<span translate="I18N_FOOTER_FOLLOW_US"></span>:
</h4>
</div>

<div class="oppia-footer-social-icons">
<div class="oppia-googleplus-follow">
<a href="https://plus.google.com/109898456505810251700/about" target="_blank">
Expand All @@ -26,7 +26,7 @@ <h4>
<span class="oppia-icon-accessibility-label">Facebook</span>
</a>
</div>

<div class="oppia-twitter-follow">
<a href="https://twitter.com/oppiaorg" target="_blank">
<i class="oppia-follow-icons fa fa-twitter"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h4 translate="I18N_PLAYER_SHARE_THIS_COLLECTION" class="oppia-share-collection-
list-style-type: none;
padding-left: 0;
}

.oppia-collection-footer li {
float: left;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
</div>

<style>

audio-bar md-progress-linear.md-default-theme .md-bar {
background-color: #009688;
}

audio-bar md-slider {
height: 5px;
}
Expand Down
6 changes: 3 additions & 3 deletions core/templates/dev/head/pages/get_started/get_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ <h2 translate="I18N_GET_STARTED_PAGE_PARAGRAPH_3_HEADING"></h2>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_3">
</p>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_4">

</p>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_5">

</p>
<ul style="margin-left: 40px;">
<li><a href="https://www.oppia.org/explore/0" target="new">Welcome to Oppia</a></li>
Expand All @@ -63,7 +63,7 @@ <h2 translate="I18N_GET_STARTED_PAGE_PARAGRAPH_9_HEADING"></h2>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_9">
</p>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_10">

</p>

<h2 translate="I18N_GET_STARTED_PAGE_PARAGRAPH_11_HEADING"></h2>
Expand Down
28 changes: 14 additions & 14 deletions scripts/pre_commit_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
}
]

BAD_PATTERNS_HTML_REGEXP = [
BAD_LINE_PATTERNS_HTML_REGEXP = [
{
'regexp': r"text\/ng-template",
'message': "The directives must be directly referenced.",
Expand All @@ -145,7 +145,7 @@
'extensions/value_generators/')
},
{
'regexp': r"([^ \t\r\n])[ \t]+$",
'regexp': r"[ \t]+$",
'message': "There should not be any trailing whitespaces.",
'excluded_files': (),
'excluded_dirs': ()
Expand Down Expand Up @@ -549,11 +549,12 @@ def _check_newline_character(all_files):
return summary_messages


def _check_bad_pattern_in_file(filename, pattern):
def _check_bad_pattern_in_file(filename, content, pattern):
"""Detects whether the given pattern is present in the file.
Args:
filename: str. Name of the file.
content: str. Contents of the file.
pattern: dict ( regexp(regex pattern) : pattern to match,
message(str) : message to show if pattern matches,
excluded_files(tuple(str)) : files to be excluded from matching,
Expand All @@ -569,14 +570,13 @@ def _check_bad_pattern_in_file(filename, pattern):
for excluded_dir in pattern['excluded_dirs'])
or filename in pattern['excluded_files']):
bad_pattern_count = 0
with open(filename, 'r') as file_to_check:
for line_num, line in enumerate(file_to_check, 1):
if re.search(regexp, line):
print 'L: %s %s --> %s' % (
line_num, filename, pattern['message'])
bad_pattern_count += 1
if bad_pattern_count:
return True
for line_num, line in enumerate(content.split('\n'), 1):
if re.search(regexp, line):
print '%s --> Line %s: %s' % (
filename, line_num, pattern['message'])
bad_pattern_count += 1
if bad_pattern_count:
return True
return False


Expand Down Expand Up @@ -607,13 +607,13 @@ def _check_bad_patterns(all_files):

if filename.endswith('.js'):
for regexp in BAD_PATTERNS_JS_REGEXP:
if _check_bad_pattern_in_file(filename, regexp):
if _check_bad_pattern_in_file(filename, content, regexp):
failed = True
total_error_count += 1

if filename.endswith('.html'):
for regexp in BAD_PATTERNS_HTML_REGEXP:
if _check_bad_pattern_in_file(filename, regexp):
for regexp in BAD_LINE_PATTERNS_HTML_REGEXP:
if _check_bad_pattern_in_file(filename, content, regexp):
failed = True
total_error_count += 1

Expand Down

0 comments on commit 54bb35f

Please sign in to comment.