Add grunt-lintspaces module to check cr-at-end in js files

We are having problems in some files, that don't have cr at the end
of the file. Some other editors are automatically adding it, so it's
highlighting non-existent differences on gerrit when editing.

Add grunt-lintspaces to ensure that all js files end with newline.
Update all the files to end with a CR to prevent these errors.

Change-Id: If0c89399dbb5cdf94384e979a3cfe8038850193b
Story: 2000089
This commit is contained in:
Yolanda Robla 2015-01-07 13:27:10 +01:00
parent c4e7615817
commit 2250dc91e2
90 changed files with 118 additions and 89 deletions

View File

@ -121,6 +121,25 @@ module.exports = function (grunt) {
}
},
/**
* grunt newlines
*
* Checks that all js files end with a newline
*/
lintspaces: {
dist: {
src: [
dir.source + '/**/*.js',
dir.test + '/**/*.js',
'./*.js'
],
options: {
newline: true,
trailingspaces: true
}
},
},
/**
* grunt recess
*
@ -444,6 +463,14 @@ module.exports = function (grunt) {
],
tasks: ['jshint']
},
lintspaces: {
files: [
'Gruntfile.js',
dir.source + '/**/*.js',
dir.test + '/**/*.js'
],
tasks: ['lintspaces']
},
livereload: {
options: {
livereload: config.livereload.port
@ -559,6 +586,7 @@ module.exports = function (grunt) {
'useminPrepare',
'concat',
'less',
'lintspaces',
'imagemin',
'html2js',
'copy:dist',

View File

@ -55,6 +55,7 @@
"selenium-standalone": "2.43.1-2.9.0-1",
"karma-html-reporter": "0.2.4",
"grunt-connect-proxy": "0.1.11",
"grunt-webfont": "0.4.8"
"grunt-webfont": "0.4.8",
"grunt-lintspaces": "0.6.0"
}
}