Skip to content

Commit

Permalink
add and run .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Jun 14, 2014
1 parent 376c224 commit 9341f47
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
@@ -0,0 +1,10 @@
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
3 changes: 2 additions & 1 deletion .npmignore
@@ -1,4 +1,5 @@
.travis.yml
.editorconfig
.jshintrc
.travis.yml
Gruntfile.coffee
test/
16 changes: 8 additions & 8 deletions Gruntfile.coffee
Expand Up @@ -3,14 +3,14 @@ module.exports = (grunt) ->

require('load-grunt-tasks') grunt
semver = require 'semver'

pkg = grunt.file.readJSON 'package.json'
MAIN = pkg.main

getNextVersion = ->
currentVer = pkg.version
semver.inc currentVer, 'patch'

grunt.initConfig
jshint:
options:
Expand All @@ -21,11 +21,11 @@ module.exports = (grunt) ->
test:
files:
src: '<%= nodeunit.all %>'

clean:
test:
src: ['test/actual/*.js']

replace:
version:
options:
Expand All @@ -47,7 +47,7 @@ module.exports = (grunt) ->
]
src: [MAIN]
dest: MAIN

uglify:
options:
preserveComments: ->
Expand All @@ -59,7 +59,7 @@ module.exports = (grunt) ->
src: '{,*/}*.js'
dest: 'test/actual'
]

nodeunit:
options:
reporter: 'default'
Expand All @@ -69,7 +69,7 @@ module.exports = (grunt) ->
main:
files: [MAIN]
tasks: ['build']

release: {}

grunt.registerTask 'test', [
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Expand Up @@ -11,11 +11,11 @@ var files = grunt.file.expandMapping (

function exportTests (map) {
var basename = path.basename(map.src);

exports[basename] = function (test) {
var actual = grunt.file.read(map.src);
var expected = grunt.file.read(map.dest);

test.strictEqual(
actual,
expected
Expand Down
6 changes: 3 additions & 3 deletions uglify-save-license.js
Expand Up @@ -21,14 +21,14 @@ module.exports = function saveLicense(node, comment) {
comment.value.charAt(0) === '!') ||
comment.line === 1 ||
comment.line === prevCommentLine + 1;

if (isLicense) {
prevCommentLine = comment.line;
} else {
prevCommentLine = 0;
}

prevFile = comment.file;

return isLicense;
};

0 comments on commit 9341f47

Please sign in to comment.