From e6721c1ed698e3eab1a3596ce6f41b606fae7c28 Mon Sep 17 00:00:00 2001 From: Caio Gondim Date: Tue, 15 Jul 2014 18:03:20 +0200 Subject: [PATCH] Adds basic formating test [Closes #7] --- Gruntfile.js | 29 +++++++++++++++++++++++++++++ makefile | 4 ++-- package.json | 9 +++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..289f7bb --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,29 @@ +module.exports = function(grunt) { + "use strict"; + + grunt.loadNpmTasks('grunt-lintspaces'); + + var config = {}; + + config.lintspaces = { + all: { + src: [ + 'Gruntfile.js', + 'makefile', + 'bullet-train.zsh-theme', + 'README.md' + ], + options: { + newline: true, + newlineMaximum: 2, + trailingspaces: true, + indentation: 'spaces', + spaces: 2 + } + }, + }; + + grunt.initConfig(config); + + grunt.registerTask("test", "lintspaces:all"); +}; diff --git a/makefile b/makefile index 3801b59..cf68c97 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ # Installs a copy of the theme on the folder `~/.oh-my-zsh/themes/` install: - cp ./bullet-train.zsh-theme ~/.oh-my-zsh/themes/bullet-train.zsh-theme + cp ./bullet-train.zsh-theme ~/.oh-my-zsh/themes/bullet-train.zsh-theme # Symlinks the theme for easier development link: - ln -sF `pwd`/bullet-train.zsh-theme ~/.oh-my-zsh/themes/ + ln -sF `pwd`/bullet-train.zsh-theme ~/.oh-my-zsh/themes/ diff --git a/package.json b/package.json index c964c8b..b1b185a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A Powerline-like theme for oh-my-zsh", "main": "bullet-train.zsh-theme", "scripts": { - "test": "npm test" + "test": "grunt test" }, "repository": { "type": "git", @@ -15,5 +15,10 @@ "bugs": { "url": "https://github.com/caiogondim/bullet-train-oh-my-zsh-theme/issues" }, - "homepage": "https://github.com/caiogondim/bullet-train-oh-my-zsh-theme" + "homepage": "https://github.com/caiogondim/bullet-train-oh-my-zsh-theme", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-cli": "^0.1.13", + "grunt-lintspaces": "^0.6.0" + } }