mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #36 from kevinansfield/linting
Add Gruntfile.js, setup linting task and Travis build
This commit is contained in:
commit
31947d24bc
5 changed files with 90 additions and 4 deletions
|
@ -6,8 +6,7 @@
|
||||||
"-Promise",
|
"-Promise",
|
||||||
"-Notification",
|
"-Notification",
|
||||||
"validator",
|
"validator",
|
||||||
"moment",
|
"moment"
|
||||||
"fileUpload"
|
|
||||||
],
|
],
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"boss": true,
|
"boss": true,
|
||||||
|
|
|
@ -5,6 +5,11 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10"
|
- "0.10"
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- node_js: "0.10"
|
||||||
|
env: TEST_SUITE=lint
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- node_modules
|
||||||
|
@ -30,4 +35,4 @@ before_script:
|
||||||
- export DISPLAY=:99; sh -e /etc/init.d/xvfb start; sleep 3;
|
- export DISPLAY=:99; sh -e /etc/init.d/xvfb start; sleep 3;
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm test
|
- if [ "$TEST_SUITE" == "lint" ]; then grunt lint; else npm test; fi
|
||||||
|
|
75
ghost/admin/Gruntfile.js
Normal file
75
ghost/admin/Gruntfile.js
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
/* global module, require, process */
|
||||||
|
/* jscs:disable */
|
||||||
|
var path = require('path'),
|
||||||
|
|
||||||
|
escapeChar = process.platform.match(/^win/) ? '^' : '\\',
|
||||||
|
cwd = process.cwd().replace(/( |\(|\))/g, escapeChar + '$1');
|
||||||
|
|
||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
// Find all of the task which start with `grunt-` and load them, rather than explicitly declaring them all
|
||||||
|
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks);
|
||||||
|
|
||||||
|
grunt.initConfig({
|
||||||
|
jshint: {
|
||||||
|
options: {
|
||||||
|
jshintrc: true,
|
||||||
|
ignores: [
|
||||||
|
'node_modules/**',
|
||||||
|
'bower_components/**',
|
||||||
|
'tmp/**',
|
||||||
|
'dist/**',
|
||||||
|
'vendor/**'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
all: ['**/*.js']
|
||||||
|
},
|
||||||
|
|
||||||
|
jscs: {
|
||||||
|
app: {
|
||||||
|
options: {
|
||||||
|
config: '.jscsrc',
|
||||||
|
excludeFiles: [
|
||||||
|
'node_modules/**',
|
||||||
|
'bower_components/**',
|
||||||
|
'tests/**',
|
||||||
|
'tmp/**',
|
||||||
|
'dist/**',
|
||||||
|
'vendor/**'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
files: {
|
||||||
|
src: ['**/*.js']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
tests: {
|
||||||
|
options: {
|
||||||
|
config: 'tests/.jscsrc'
|
||||||
|
},
|
||||||
|
|
||||||
|
files: {
|
||||||
|
src: [
|
||||||
|
'tests/**/*.js'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
shell: {
|
||||||
|
csscombfix: {
|
||||||
|
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -v app/styles')
|
||||||
|
},
|
||||||
|
|
||||||
|
csscomblint: {
|
||||||
|
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -lv app/styles')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
grunt.registerTask('lint', 'Run the code style checks and linter',
|
||||||
|
['jshint', 'jscs', 'shell:csscomblint']
|
||||||
|
);
|
||||||
|
};
|
|
@ -20,6 +20,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"broccoli-asset-rev": "2.4.2",
|
"broccoli-asset-rev": "2.4.2",
|
||||||
|
"csscomb": "3.1.8",
|
||||||
"ember-ajax": "0.7.1",
|
"ember-ajax": "0.7.1",
|
||||||
"ember-cli": "2.5.1",
|
"ember-cli": "2.5.1",
|
||||||
"ember-cli-app-version": "1.0.0",
|
"ember-cli-app-version": "1.0.0",
|
||||||
|
@ -58,9 +59,14 @@
|
||||||
"emberx-file-input": "1.0.0",
|
"emberx-file-input": "1.0.0",
|
||||||
"fs-extra": "0.30.0",
|
"fs-extra": "0.30.0",
|
||||||
"glob": "^7.0.3",
|
"glob": "^7.0.3",
|
||||||
|
"grunt": "1.0.1",
|
||||||
|
"grunt-contrib-jshint": "1.0.0",
|
||||||
|
"grunt-jscs": "2.8.0",
|
||||||
|
"grunt-shell": "1.3.0",
|
||||||
"liquid-fire": "0.23.1",
|
"liquid-fire": "0.23.1",
|
||||||
"liquid-tether": "1.1.1",
|
"liquid-tether": "1.1.1",
|
||||||
"loader.js": "4.0.7",
|
"loader.js": "4.0.7",
|
||||||
|
"matchdep": "1.0.1",
|
||||||
"walk-sync": "^0.2.6"
|
"walk-sync": "^0.2.6"
|
||||||
},
|
},
|
||||||
"ember-addon": {
|
"ember-addon": {
|
||||||
|
|
|
@ -26,7 +26,8 @@
|
||||||
"currentURL",
|
"currentURL",
|
||||||
"currentPath",
|
"currentPath",
|
||||||
"currentRouteName",
|
"currentRouteName",
|
||||||
"expect"
|
"expect",
|
||||||
|
"fileUpload"
|
||||||
],
|
],
|
||||||
"mocha": true,
|
"mocha": true,
|
||||||
"node": false,
|
"node": false,
|
||||||
|
|
Loading…
Add table
Reference in a new issue