Skip to content

Commit

Permalink
setup automation, code cleanup and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyrne01 committed Feb 19, 2015
1 parent 7939fd1 commit 12357f2
Show file tree
Hide file tree
Showing 20 changed files with 932 additions and 86 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/validation-report.json
/validation-status.json
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language:
- node_js

# whitelist
branches:
only:
- master

before_install: npm install -g grunt-cli
install: npm install

script:
- grunt
106 changes: 106 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
module.exports = function (grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['Gruntfile.js', 'package.json', 'addon/package.json', 'addon/lib/*.js', 'addon/data/js/*.js'],
options: {
moz: true,
force: true, // don't stop when there is an error
maxerr: 10000 // keep running no matter how many errors were found
}
},
jsbeautifier: {
files: ['<%= jshint.files %>', 'addon/data/html/view.html'],
options: {
js: {
braceStyle: "collapse",
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: "\t",
indentLevel: 0,
indentSize: 1,
indentWithTabs: true,
jslintHappy: true,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0
},
html: {
braceStyle: "collapse",
indentChar: "\t",
indentScripts: "keep",
indentSize: 1,
maxPreserveNewlines: 10,
preserveNewlines: true,
unformatted: ["a", "sub", "sup", "b", "i", "u"],
wrapLineLength: 0
}
}
},
validation: {
options: {
stoponerror: false,
reset: true,
},
files: {
src: ['addon/data/html/*.html']
}
},
csslint: {
strict: {
options: {
import: 2
},
src: ['addon/data/css/*.css']
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
},
notify_hooks: {
options: {
enabled: true,
max_jshint_notifications: 2,
success: true
}
},
release: {
options: {
file: 'package.json',
additionalFiles: ['addon/package.json'],
bump: true,
add: true,
commit: true,
tag: true,
push: true,
pushTags: true,
npm: false,
npmtag: false,
github: {
repo: 'bobbyrne01/tab-data-firefox',
usernameVar: 'GITHUB_USERNAME',
passwordVar: 'GITHUB_PASSWORD'
}
}
}
});

grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-release');

grunt.registerTask('default', ['jsbeautifier', 'jshint', 'validation', 'csslint']);
grunt.task.run('notify_hooks');
};
Loading

0 comments on commit 12357f2

Please sign in to comment.