From 93e2ff3952969a91381f90b4cb74cc970f4b00cb Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Wed, 11 Jun 2014 21:10:05 +0900 Subject: [PATCH] Integrate grunt-scss-lint --- .scss-lint.yml | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ Gruntfile.js | 10 +++- package.json | 1 + 3 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 .scss-lint.yml diff --git a/.scss-lint.yml b/.scss-lint.yml new file mode 100644 index 0000000..fe6cc65 --- /dev/null +++ b/.scss-lint.yml @@ -0,0 +1,122 @@ +# Default application configuration that all configurations inherit from. +linters: + BorderZero: + enabled: true + + CapitalizationInSelector: + enabled: true + + ColorKeyword: + enabled: true + + Comment: + enabled: true + + DebugStatement: + enabled: true + + DeclarationOrder: + enabled: true + + DuplicateProperty: + enabled: true + + EmptyLineBetweenBlocks: + enabled: true + ignore_single_line_blocks: true + + EmptyRule: + enabled: true + + FinalNewline: + enabled: true + present: true + + HexLength: + enabled: true + style: short # or 'long' + + HexNotation: + enabled: true + style: lowercase # or 'uppercase' + + HexValidation: + enabled: true + + IdWithExtraneousSelector: + enabled: true + + Indentation: + enabled: true + width: 2 + + LeadingZero: + enabled: true + style: exclude_zero # or 'include_zero' + + MergeableSelector: + enabled: true + force_nesting: true + + NameFormat: + enabled: true + convention: hyphenated_lowercase # or 'BEM', or a regex pattern + + PlaceholderInExtend: + enabled: true + + PropertySortOrder: + enabled: true + + PropertySpelling: + enabled: true + extra_properties: [] + + SelectorDepth: + enabled: true + max_depth: 3 + + Shorthand: + enabled: true + + SingleLinePerSelector: + enabled: true + + SpaceAfterComma: + enabled: true + + SpaceAfterPropertyColon: + enabled: true + + SpaceAfterPropertyName: + enabled: true + + SpaceBeforeBrace: + enabled: true + allow_single_line_padding: false + + SpaceBetweenParens: + enabled: true + spaces: 0 + + StringQuotes: + enabled: true + style: single_quotes # or double_quotes + + TrailingSemicolonAfterPropertyValue: + enabled: true + + UnnecessaryMantissa: + enabled: true + + UrlFormat: + enabled: true + + UrlQuotes: + enabled: true + + ZeroUnit: + enabled: true + + Compass::*: + enabled: false \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index a0419bf..f671886 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -76,6 +76,14 @@ module.exports = function(grunt) { } }, + scsslint: { + scss: 'sass/*.scss', + options: { + config: '.scss-lint.yml', + colorizeOutput: true + } + }, + csscomb: { options: { config: 'sass/.csscomb.json' @@ -253,7 +261,7 @@ module.exports = function(grunt) { grunt.registerTask('validate-html', ['jekyll', 'validation']); grunt.registerTask('build', ['dist']); grunt.registerTask('default', ['dist']); - grunt.registerTask('test', ['dist', 'csslint', 'jshint', 'jscs', 'validate-html']); + grunt.registerTask('test', ['dist', 'scsslint', 'csslint', 'jshint', 'jscs', 'validate-html']); grunt.registerTask('build-ratchicons-data', generateRatchiconsData); diff --git a/package.json b/package.json index 4a9f545..2647343 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "grunt-html-validation": "~0.1.17", "grunt-jekyll": "~0.4.2", "grunt-jscs-checker": "~0.4.4", + "grunt-scss-lint": "^0.1.11", "grunt-sed": "~0.1.1", "load-grunt-tasks": "~0.4.0", "time-grunt": "~0.3.1"