Skip to content

Commit

Permalink
Add regex for trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
apb7 committed Feb 16, 2018
1 parent 46bc6cc commit cf7d5db
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

<md-card class="oppia-page-card oppia-long-text">
<form class="form-horizontal" name="updateRoleForm" ng-submit="submitUpdateRoleForm(updateFormValues)">
<legend class="text-center">Update Role</legend>
<legend class="text-center">Update Role</legend>
<div class="form-group">
<label class="col-md-4 col-lg-4 col-sm-4 control-label">Enter Username</label>
<div class="col-md-8 col-lg-8 col-sm-8">
Expand All @@ -82,18 +82,18 @@
</select>
</div>
</div>

<button type="submit" class="btn btn-success protractor-update-form-submit" ng-disabled="!updateFormValues.newRole || !updateFormValues.username" value="update role">Update Role</button>
</form>
</md-card>
</div>

<div class="col-md-4">
<md-card class="oppia-page-card oppia-long-text" style="">
<legend class="text-center">Role Hierarchy</legend>
<role-graph graph-data="graphData"
graph-data-loaded="graphDataLoaded">
</role-graph>
</role-graph>
</md-card>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p ng-class="{'has-error': !explorationTitleService.displayed.length > 0}">
<label for="explorationTitle" ng-style="<[::formStyle]>"><[::labelText]></label>
<input id="explorationTitle" type="text" class="form-control protractor-test-exploration-title-input"
ng-model="explorationTitleService.displayed" ng-blur="onInputFieldBlur()"
placeholder="Choose a title for your exploration." focus-on="<[::focusLabel]>"
<input id="explorationTitle" type="text" class="form-control protractor-test-exploration-title-input"
ng-model="explorationTitleService.displayed" ng-blur="onInputFieldBlur()"
placeholder="Choose a title for your exploration." focus-on="<[::focusLabel]>"
maxlength="40" ng-trim="false">
<span class="help-block" style="font-size: smaller">
<em>Please use at most 40 characters, so that this fits in the summary card.</em>
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/get_started/get_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h2 translate="I18N_GET_STARTED_PAGE_PARAGRAPH_3_HEADING"></h2>
<li><a href="https://www.oppia.org/collection/wqCTKpKA0LBe" target="new">Get Electrified!</a></li>
<li><a href="https://www.oppia.org/collection/inDXV0w8-p1C" target="new">Programming with Carla</a></li>
</ul>
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_6">
<p translate="I18N_GET_STARTED_PAGE_PARAGRAPH_6">
</p>

<h2 translate="I18N_GET_STARTED_PAGE_PARAGRAPH_7_HEADING"></h2>
Expand Down
6 changes: 3 additions & 3 deletions extensions/objects/templates/image_with_regions_editor.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div ng-if="$parent.value.imagePath === ''">
<schema-based-editor
local-value="$parent.$parent.value.imagePath"
<schema-based-editor
local-value="$parent.$parent.value.imagePath"
schema="{type: 'custom', obj_type: 'Filepath'}">
</schema-based-editor>
</div>
Expand Down Expand Up @@ -66,7 +66,7 @@
<div style="color: red; margin-bottom: 4px"><[errorText]></div>
<button type="button" class="btn btn-danger" ng-click="resetEditor()">Clear Image and Regions</button>
</div>
<script type="text/ng-template" id="modals/imageRegionsResetConfirmation">
<script type="text/ng-template" id="modals/imageRegionsResetConfirmation">
<div class="modal-header">
<h4 class="modal-title">Clear Image and Regions</h4>
</div>
Expand Down
8 changes: 7 additions & 1 deletion scripts/pre_commit_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@
'extensions/classifiers/',
'extensions/objects/',
'extensions/value_generators/')
},
{
'regexp': r"([^ \t\r\n])[ \t]+$",
'message': "There should not be any trailing whitespaces.",
'excluded_files': (),
'excluded_dirs': ()
}
]

Expand Down Expand Up @@ -563,7 +569,7 @@ def _check_bad_pattern_in_file(filename, content, pattern):
if not (any(filename.startswith(excluded_dir)
for excluded_dir in pattern['excluded_dirs'])
or filename in pattern['excluded_files']):
if re.search(regexp, content):
if re.search(regexp, content, re.MULTILINE):
print '%s --> %s' % (
filename, pattern['message'])
return True
Expand Down

0 comments on commit cf7d5db

Please sign in to comment.