lint 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e0f9a485c9a5a85d24cfbdf96577ff34ffd04cb5
4
+ data.tar.gz: f9eb7833a4ef72d50fa556e0f94544ca99425589
5
+ SHA512:
6
+ metadata.gz: 298eb7d46a9ac5e59cc472df30b4e6a8833d982edbc50208a3a386ed2ede768c727fddf4b22156998ba79bc282a6b666183723d5cf4a934f82e824debbb2b257
7
+ data.tar.gz: a956ec462980dff2185a7651c02c0a4b401d9d1452e40074f252afbd1fb9fa164131953d4967ef4b0a7d94ee8061da91a6f5f3e8efe373fe1a979db93a3dab3f
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ ## Master
4
+
5
+ ## 0.1.0
6
+
7
+ * scss-lint gem integrated
8
+
9
+ ## 0.0.1
10
+
11
+ Initial release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in lint.gemspec
4
+ gemspec
data/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Matthias Siegel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # lint
2
+
3
+ A collection of code linters and opinionated config files.
4
+
5
+ Made primarily for internal use.
6
+
7
+ Currently only works with Rails because it uses Railties.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile (in the development/test group):
12
+
13
+ gem 'lint'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it manually as:
20
+
21
+ $ gem install lint
22
+
23
+ ## Usage
24
+
25
+ After adding the gem, the following Rake tasks become available:
26
+
27
+ rake lint:scss
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it
32
+ 2. Create your feature branch
33
+ 3. Commit your changes
34
+ 4. Push to the branch
35
+ 5. Create new Pull Request
36
+
37
+ ## Copyright
38
+
39
+ Copyright (c) 2015 Matthias Siegel. See [LICENSE][] for details.
40
+
41
+ ## Changelog
42
+
43
+ See [CHANGELOG][] for details.
44
+
45
+ [license]: LICENSE.md
46
+ [changelog]: CHANGELOG.md
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,203 @@
1
+ scss_files: "**/*.scss"
2
+
3
+ linters:
4
+ BangFormat:
5
+ enabled: true
6
+ space_before_bang: true
7
+ space_after_bang: false
8
+
9
+ BorderZero:
10
+ enabled: true
11
+ convention: zero # or `none`
12
+
13
+ ColorKeyword:
14
+ enabled: true
15
+
16
+ ColorVariable:
17
+ enabled: true
18
+
19
+ Comment:
20
+ enabled: true
21
+
22
+ DebugStatement:
23
+ enabled: true
24
+
25
+ DeclarationOrder:
26
+ enabled: true
27
+
28
+ DuplicateProperty:
29
+ enabled: true
30
+
31
+ ElsePlacement:
32
+ enabled: true
33
+ style: same_line # or 'new_line'
34
+
35
+ EmptyLineBetweenBlocks:
36
+ enabled: true
37
+ ignore_single_line_blocks: true
38
+
39
+ EmptyRule:
40
+ enabled: true
41
+
42
+ FinalNewline:
43
+ enabled: true
44
+ present: true
45
+
46
+ HexLength:
47
+ enabled: true
48
+ style: short # or 'long'
49
+
50
+ HexNotation:
51
+ enabled: true
52
+ style: lowercase # or 'uppercase'
53
+
54
+ HexValidation:
55
+ enabled: true
56
+
57
+ IdSelector:
58
+ enabled: true
59
+
60
+ ImportantRule:
61
+ enabled: true
62
+
63
+ ImportPath:
64
+ enabled: true
65
+ leading_underscore: false
66
+ filename_extension: false
67
+
68
+ Indentation:
69
+ enabled: true
70
+ allow_non_nested_indentation: false
71
+ character: space # or 'tab'
72
+ width: 2
73
+
74
+ LeadingZero:
75
+ enabled: true
76
+ style: include_zero # or 'exclude_zero'
77
+
78
+ MergeableSelector:
79
+ enabled: true
80
+ force_nesting: true
81
+
82
+ NameFormat:
83
+ enabled: true
84
+ allow_leading_underscore: true
85
+ convention: hyphenated_lowercase # or 'camel_case', or 'snake_case', or a regex pattern
86
+
87
+ NestingDepth:
88
+ enabled: true
89
+ max_depth: 5
90
+
91
+ PlaceholderInExtend:
92
+ enabled: false
93
+
94
+ PropertyCount:
95
+ enabled: false
96
+ include_nested: false
97
+ max_properties: 10
98
+
99
+ PropertyUnits:
100
+ enabled: true
101
+ global: [
102
+ 'ch', 'em', 'ex', 'rem', # Font-relative lengths
103
+ 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths
104
+ 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths
105
+ 'deg', 'grad', 'rad', 'turn', # Angle
106
+ 'ms', 's', # Duration
107
+ 'Hz', 'kHz', # Frequency
108
+ 'dpi', 'dpcm', 'dppx', # Resolution
109
+ '%', # Other
110
+ ]
111
+ properties: {}
112
+
113
+ PropertySortOrder:
114
+ enabled: true
115
+ ignore_unspecified: false
116
+ min_properties: 2
117
+ separate_groups: false
118
+
119
+ PropertySpelling:
120
+ enabled: true
121
+ extra_properties: []
122
+
123
+ QualifyingElement:
124
+ enabled: true
125
+ allow_element_with_attribute: false
126
+ allow_element_with_class: false
127
+ allow_element_with_id: false
128
+
129
+ SelectorDepth:
130
+ enabled: true
131
+ max_depth: 5
132
+
133
+ SelectorFormat:
134
+ enabled: true
135
+ convention: hyphenated_lowercase # or 'strict_BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
136
+
137
+ Shorthand:
138
+ enabled: true
139
+ allowed_shorthands: [1, 2, 3]
140
+
141
+ SingleLinePerProperty:
142
+ enabled: true
143
+ allow_single_line_rule_sets: true
144
+
145
+ SingleLinePerSelector:
146
+ enabled: true
147
+
148
+ SpaceAfterComma:
149
+ enabled: true
150
+
151
+ SpaceAfterPropertyColon:
152
+ enabled: true
153
+ style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
154
+
155
+ SpaceAfterPropertyName:
156
+ enabled: true
157
+
158
+ SpaceBeforeBrace:
159
+ enabled: true
160
+ style: space # or 'new_line'
161
+ allow_single_line_padding: true
162
+
163
+ SpaceBetweenParens:
164
+ enabled: true
165
+ spaces: 0
166
+
167
+ StringQuotes:
168
+ enabled: true
169
+ style: single_quotes # or double_quotes
170
+
171
+ TrailingSemicolon:
172
+ enabled: true
173
+
174
+ TrailingZero:
175
+ enabled: false
176
+
177
+ UnnecessaryMantissa:
178
+ enabled: true
179
+
180
+ UnnecessaryParentReference:
181
+ enabled: true
182
+
183
+ UrlFormat:
184
+ enabled: true
185
+
186
+ UrlQuotes:
187
+ enabled: true
188
+
189
+ VariableForProperty:
190
+ enabled: false
191
+ properties: []
192
+
193
+ VendorPrefix:
194
+ enabled: true
195
+ identifier_list: base
196
+ additional_identifiers: []
197
+ excluded_identifiers: []
198
+
199
+ ZeroUnit:
200
+ enabled: true
201
+
202
+ Compass::*:
203
+ enabled: false
@@ -0,0 +1,9 @@
1
+ module Lint
2
+ class Railtie < Rails::Railtie
3
+ railtie_name :lint
4
+
5
+ rake_tasks do
6
+ load 'tasks/lint.rake'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Lint
2
+ VERSION = '0.1.0'
3
+ end
data/lib/lint.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'lint/version'
2
+
3
+ module Lint
4
+ require 'lint/railtie' if defined?(Rails)
5
+ end
@@ -0,0 +1,12 @@
1
+ namespace :lint do
2
+
3
+ desc "Run SCSS quality checks"
4
+ task :scss do
5
+ exit(1) unless system("scss-lint app/assets/stylesheets --config #{config('scss-lint.yml')}")
6
+ end
7
+
8
+ def config(file)
9
+ File.realdirpath("#{__FILE__}/../../../config/#{file}")
10
+ end
11
+
12
+ end
data/lint.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'lint/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'lint'
7
+ spec.version = Lint::VERSION
8
+ spec.authors = ['Matthias Siegel']
9
+ spec.email = ['matthias.siegel@gmail.com']
10
+ spec.summary = %q{A collection of code linters.}
11
+ spec.description = %q{A collection of code linters and opinionated config files.}
12
+ spec.homepage = 'https://github.com/choc/lint'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.test_files = spec.files.grep(%r{^(spec)/})
17
+ spec.require_paths = ['lib']
18
+
19
+ spec.add_dependency 'scss-lint', '~> 0.38.0'
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Matthias Siegel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: scss-lint
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.38.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.38.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: A collection of code linters and opinionated config files.
56
+ email:
57
+ - matthias.siegel@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - LICENSE.md
66
+ - README.md
67
+ - Rakefile
68
+ - config/scss-lint.yml
69
+ - lib/lint.rb
70
+ - lib/lint/railtie.rb
71
+ - lib/lint/version.rb
72
+ - lib/tasks/lint.rake
73
+ - lint.gemspec
74
+ homepage: https://github.com/choc/lint
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.4.5
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: A collection of code linters.
98
+ test_files: []