scss_lint 0.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +7 -0
  2. data/bin/scss-lint +6 -0
  3. data/config/default.yml +205 -0
  4. data/data/prefixed-identifiers/base.txt +107 -0
  5. data/data/prefixed-identifiers/bourbon.txt +71 -0
  6. data/data/properties.txt +477 -0
  7. data/data/property-sort-orders/concentric.txt +134 -0
  8. data/data/property-sort-orders/recess.txt +149 -0
  9. data/data/property-sort-orders/smacss.txt +137 -0
  10. data/lib/scss_lint.rb +31 -0
  11. data/lib/scss_lint/cli.rb +215 -0
  12. data/lib/scss_lint/config.rb +251 -0
  13. data/lib/scss_lint/constants.rb +8 -0
  14. data/lib/scss_lint/control_comment_processor.rb +126 -0
  15. data/lib/scss_lint/engine.rb +56 -0
  16. data/lib/scss_lint/exceptions.rb +21 -0
  17. data/lib/scss_lint/file_finder.rb +68 -0
  18. data/lib/scss_lint/lint.rb +24 -0
  19. data/lib/scss_lint/linter.rb +161 -0
  20. data/lib/scss_lint/linter/bang_format.rb +52 -0
  21. data/lib/scss_lint/linter/border_zero.rb +39 -0
  22. data/lib/scss_lint/linter/color_keyword.rb +32 -0
  23. data/lib/scss_lint/linter/color_variable.rb +60 -0
  24. data/lib/scss_lint/linter/comment.rb +21 -0
  25. data/lib/scss_lint/linter/compass.rb +7 -0
  26. data/lib/scss_lint/linter/compass/property_with_mixin.rb +47 -0
  27. data/lib/scss_lint/linter/debug_statement.rb +10 -0
  28. data/lib/scss_lint/linter/declaration_order.rb +71 -0
  29. data/lib/scss_lint/linter/duplicate_property.rb +58 -0
  30. data/lib/scss_lint/linter/else_placement.rb +48 -0
  31. data/lib/scss_lint/linter/empty_line_between_blocks.rb +85 -0
  32. data/lib/scss_lint/linter/empty_rule.rb +11 -0
  33. data/lib/scss_lint/linter/final_newline.rb +20 -0
  34. data/lib/scss_lint/linter/hex_length.rb +56 -0
  35. data/lib/scss_lint/linter/hex_notation.rb +38 -0
  36. data/lib/scss_lint/linter/hex_validation.rb +23 -0
  37. data/lib/scss_lint/linter/id_selector.rb +10 -0
  38. data/lib/scss_lint/linter/import_path.rb +62 -0
  39. data/lib/scss_lint/linter/important_rule.rb +12 -0
  40. data/lib/scss_lint/linter/indentation.rb +197 -0
  41. data/lib/scss_lint/linter/leading_zero.rb +49 -0
  42. data/lib/scss_lint/linter/mergeable_selector.rb +60 -0
  43. data/lib/scss_lint/linter/name_format.rb +117 -0
  44. data/lib/scss_lint/linter/nesting_depth.rb +24 -0
  45. data/lib/scss_lint/linter/placeholder_in_extend.rb +22 -0
  46. data/lib/scss_lint/linter/property_count.rb +44 -0
  47. data/lib/scss_lint/linter/property_sort_order.rb +198 -0
  48. data/lib/scss_lint/linter/property_spelling.rb +49 -0
  49. data/lib/scss_lint/linter/property_units.rb +59 -0
  50. data/lib/scss_lint/linter/qualifying_element.rb +42 -0
  51. data/lib/scss_lint/linter/selector_depth.rb +64 -0
  52. data/lib/scss_lint/linter/selector_format.rb +102 -0
  53. data/lib/scss_lint/linter/shorthand.rb +139 -0
  54. data/lib/scss_lint/linter/single_line_per_property.rb +59 -0
  55. data/lib/scss_lint/linter/single_line_per_selector.rb +35 -0
  56. data/lib/scss_lint/linter/space_after_comma.rb +110 -0
  57. data/lib/scss_lint/linter/space_after_property_colon.rb +92 -0
  58. data/lib/scss_lint/linter/space_after_property_name.rb +27 -0
  59. data/lib/scss_lint/linter/space_before_brace.rb +72 -0
  60. data/lib/scss_lint/linter/space_between_parens.rb +35 -0
  61. data/lib/scss_lint/linter/string_quotes.rb +94 -0
  62. data/lib/scss_lint/linter/trailing_semicolon.rb +67 -0
  63. data/lib/scss_lint/linter/trailing_zero.rb +41 -0
  64. data/lib/scss_lint/linter/unnecessary_mantissa.rb +42 -0
  65. data/lib/scss_lint/linter/unnecessary_parent_reference.rb +49 -0
  66. data/lib/scss_lint/linter/url_format.rb +56 -0
  67. data/lib/scss_lint/linter/url_quotes.rb +27 -0
  68. data/lib/scss_lint/linter/variable_for_property.rb +30 -0
  69. data/lib/scss_lint/linter/vendor_prefix.rb +64 -0
  70. data/lib/scss_lint/linter/zero_unit.rb +39 -0
  71. data/lib/scss_lint/linter_registry.rb +26 -0
  72. data/lib/scss_lint/location.rb +38 -0
  73. data/lib/scss_lint/options.rb +109 -0
  74. data/lib/scss_lint/rake_task.rb +106 -0
  75. data/lib/scss_lint/reporter.rb +18 -0
  76. data/lib/scss_lint/reporter/config_reporter.rb +26 -0
  77. data/lib/scss_lint/reporter/default_reporter.rb +27 -0
  78. data/lib/scss_lint/reporter/files_reporter.rb +8 -0
  79. data/lib/scss_lint/reporter/json_reporter.rb +30 -0
  80. data/lib/scss_lint/reporter/xml_reporter.rb +33 -0
  81. data/lib/scss_lint/runner.rb +51 -0
  82. data/lib/scss_lint/sass/script.rb +78 -0
  83. data/lib/scss_lint/sass/tree.rb +168 -0
  84. data/lib/scss_lint/selector_visitor.rb +34 -0
  85. data/lib/scss_lint/utils.rb +112 -0
  86. data/lib/scss_lint/version.rb +4 -0
  87. data/spec/scss_lint/cli_spec.rb +177 -0
  88. data/spec/scss_lint/config_spec.rb +253 -0
  89. data/spec/scss_lint/engine_spec.rb +24 -0
  90. data/spec/scss_lint/file_finder_spec.rb +134 -0
  91. data/spec/scss_lint/linter/bang_format_spec.rb +121 -0
  92. data/spec/scss_lint/linter/border_zero_spec.rb +118 -0
  93. data/spec/scss_lint/linter/color_keyword_spec.rb +83 -0
  94. data/spec/scss_lint/linter/color_variable_spec.rb +155 -0
  95. data/spec/scss_lint/linter/comment_spec.rb +79 -0
  96. data/spec/scss_lint/linter/compass/property_with_mixin_spec.rb +55 -0
  97. data/spec/scss_lint/linter/debug_statement_spec.rb +21 -0
  98. data/spec/scss_lint/linter/declaration_order_spec.rb +575 -0
  99. data/spec/scss_lint/linter/duplicate_property_spec.rb +189 -0
  100. data/spec/scss_lint/linter/else_placement_spec.rb +106 -0
  101. data/spec/scss_lint/linter/empty_line_between_blocks_spec.rb +276 -0
  102. data/spec/scss_lint/linter/empty_rule_spec.rb +27 -0
  103. data/spec/scss_lint/linter/final_newline_spec.rb +49 -0
  104. data/spec/scss_lint/linter/hex_length_spec.rb +104 -0
  105. data/spec/scss_lint/linter/hex_notation_spec.rb +104 -0
  106. data/spec/scss_lint/linter/hex_validation_spec.rb +40 -0
  107. data/spec/scss_lint/linter/id_selector_spec.rb +62 -0
  108. data/spec/scss_lint/linter/import_path_spec.rb +300 -0
  109. data/spec/scss_lint/linter/important_rule_spec.rb +43 -0
  110. data/spec/scss_lint/linter/indentation_spec.rb +347 -0
  111. data/spec/scss_lint/linter/leading_zero_spec.rb +233 -0
  112. data/spec/scss_lint/linter/mergeable_selector_spec.rb +283 -0
  113. data/spec/scss_lint/linter/name_format_spec.rb +282 -0
  114. data/spec/scss_lint/linter/nesting_depth_spec.rb +114 -0
  115. data/spec/scss_lint/linter/placeholder_in_extend_spec.rb +63 -0
  116. data/spec/scss_lint/linter/property_count_spec.rb +104 -0
  117. data/spec/scss_lint/linter/property_sort_order_spec.rb +482 -0
  118. data/spec/scss_lint/linter/property_spelling_spec.rb +84 -0
  119. data/spec/scss_lint/linter/property_units_spec.rb +229 -0
  120. data/spec/scss_lint/linter/qualifying_element_spec.rb +125 -0
  121. data/spec/scss_lint/linter/selector_depth_spec.rb +159 -0
  122. data/spec/scss_lint/linter/selector_format_spec.rb +632 -0
  123. data/spec/scss_lint/linter/shorthand_spec.rb +198 -0
  124. data/spec/scss_lint/linter/single_line_per_property_spec.rb +73 -0
  125. data/spec/scss_lint/linter/single_line_per_selector_spec.rb +130 -0
  126. data/spec/scss_lint/linter/space_after_comma_spec.rb +332 -0
  127. data/spec/scss_lint/linter/space_after_property_colon_spec.rb +373 -0
  128. data/spec/scss_lint/linter/space_after_property_name_spec.rb +37 -0
  129. data/spec/scss_lint/linter/space_before_brace_spec.rb +829 -0
  130. data/spec/scss_lint/linter/space_between_parens_spec.rb +263 -0
  131. data/spec/scss_lint/linter/string_quotes_spec.rb +335 -0
  132. data/spec/scss_lint/linter/trailing_semicolon_spec.rb +304 -0
  133. data/spec/scss_lint/linter/trailing_zero_spec.rb +176 -0
  134. data/spec/scss_lint/linter/unnecessary_mantissa_spec.rb +67 -0
  135. data/spec/scss_lint/linter/unnecessary_parent_reference_spec.rb +98 -0
  136. data/spec/scss_lint/linter/url_format_spec.rb +55 -0
  137. data/spec/scss_lint/linter/url_quotes_spec.rb +73 -0
  138. data/spec/scss_lint/linter/variable_for_property_spec.rb +145 -0
  139. data/spec/scss_lint/linter/vendor_prefix_spec.rb +371 -0
  140. data/spec/scss_lint/linter/zero_unit_spec.rb +113 -0
  141. data/spec/scss_lint/linter_registry_spec.rb +50 -0
  142. data/spec/scss_lint/linter_spec.rb +292 -0
  143. data/spec/scss_lint/location_spec.rb +42 -0
  144. data/spec/scss_lint/options_spec.rb +34 -0
  145. data/spec/scss_lint/rake_task_spec.rb +43 -0
  146. data/spec/scss_lint/reporter/config_reporter_spec.rb +42 -0
  147. data/spec/scss_lint/reporter/default_reporter_spec.rb +73 -0
  148. data/spec/scss_lint/reporter/files_reporter_spec.rb +38 -0
  149. data/spec/scss_lint/reporter/json_reporter_spec.rb +96 -0
  150. data/spec/scss_lint/reporter/xml_reporter_spec.rb +103 -0
  151. data/spec/scss_lint/reporter_spec.rb +11 -0
  152. data/spec/scss_lint/runner_spec.rb +123 -0
  153. data/spec/scss_lint/selector_visitor_spec.rb +264 -0
  154. data/spec/spec_helper.rb +34 -0
  155. data/spec/support/isolated_environment.rb +25 -0
  156. data/spec/support/matchers/report_lint.rb +48 -0
  157. metadata +328 -0
@@ -0,0 +1,134 @@
1
+ # Concentric CSS
2
+ # http://rhodesmill.org/brandon/2011/concentric-css/
3
+
4
+ display
5
+ position
6
+ top
7
+ right
8
+ bottom
9
+ left
10
+
11
+ columns
12
+ column-gap
13
+ column-fill
14
+ column-rule
15
+ column-span
16
+ column-count
17
+ column-width
18
+
19
+ float
20
+ clear
21
+
22
+ transform
23
+ transition
24
+
25
+ animation
26
+ animation-name
27
+ animation-duration
28
+ animation-timing-function
29
+ animation-delay
30
+ animation-iteration-count
31
+ animation-direction
32
+ animation-fill-mode
33
+ animation-play-state
34
+
35
+ visibility
36
+ opacity
37
+ z-index
38
+
39
+ margin
40
+ margin-top
41
+ margin-right
42
+ margin-bottom
43
+ margin-left
44
+
45
+ outline
46
+
47
+ border
48
+ border-top
49
+ border-right
50
+ border-bottom
51
+ border-left
52
+ border-width
53
+ border-top-width
54
+ border-right-width
55
+ border-bottom-width
56
+ border-left-width
57
+
58
+ border-style
59
+ border-top-style
60
+ border-right-style
61
+ border-bottom-style
62
+ border-left-style
63
+
64
+ border-radius
65
+ border-top-left-radius
66
+ border-top-right-radius
67
+ border-bottom-left-radius
68
+ border-bottom-right-radius
69
+
70
+ border-color
71
+ border-top-color
72
+ border-right-color
73
+ border-bottom-color
74
+ border-left-color
75
+
76
+ box-shadow
77
+
78
+ background
79
+ background-color
80
+ background-image
81
+ background-repeat
82
+ background-position
83
+ background-size
84
+ cursor
85
+
86
+ padding
87
+ padding-top
88
+ padding-right
89
+ padding-bottom
90
+ padding-left
91
+
92
+ width
93
+ min-width
94
+ max-width
95
+
96
+ height
97
+ min-height
98
+ max-height
99
+
100
+ overflow
101
+
102
+ list-style
103
+ caption-side
104
+
105
+ table-layout
106
+ border-collapse
107
+ border-spacing
108
+ empty-cells
109
+
110
+ vertical-align
111
+
112
+ text-align
113
+ text-indent
114
+ text-transform
115
+ text-decoration
116
+ text-rendering
117
+ text-shadow
118
+ text-overflow
119
+
120
+ line-height
121
+ word-spacing
122
+ letter-spacing
123
+ white-space
124
+ color
125
+
126
+ font
127
+ font-family
128
+ font-size
129
+ font-weight
130
+ font-smoothing
131
+ font-style
132
+
133
+ content
134
+ quotes
@@ -0,0 +1,149 @@
1
+ # RECESS Property Order
2
+ # https://github.com/twitter/recess
3
+
4
+ position
5
+ top
6
+ right
7
+ bottom
8
+ left
9
+ z-index
10
+ display
11
+ float
12
+ width
13
+ height
14
+ max-width
15
+ max-height
16
+ min-width
17
+ min-height
18
+ padding
19
+ padding-top
20
+ padding-right
21
+ padding-bottom
22
+ padding-left
23
+ margin
24
+ margin-top
25
+ margin-right
26
+ margin-bottom
27
+ margin-left
28
+ margin-collapse
29
+ margin-top-collapse
30
+ margin-right-collapse
31
+ margin-bottom-collapse
32
+ margin-left-collapse
33
+ overflow
34
+ overflow-x
35
+ overflow-y
36
+ clip
37
+ clear
38
+ font
39
+ font-family
40
+ font-size
41
+ font-smoothing
42
+ osx-font-smoothing
43
+ font-style
44
+ font-weight
45
+ hyphens
46
+ src
47
+ line-height
48
+ letter-spacing
49
+ word-spacing
50
+ color
51
+ text-align
52
+ text-decoration
53
+ text-indent
54
+ text-overflow
55
+ text-rendering
56
+ text-size-adjust
57
+ text-shadow
58
+ text-transform
59
+ word-break
60
+ word-wrap
61
+ white-space
62
+ vertical-align
63
+ list-style
64
+ list-style-type
65
+ list-style-position
66
+ list-style-image
67
+ pointer-events
68
+ cursor
69
+ background
70
+ background-attachment
71
+ background-color
72
+ background-image
73
+ background-position
74
+ background-repeat
75
+ background-size
76
+ border
77
+ border-collapse
78
+ border-top
79
+ border-right
80
+ border-bottom
81
+ border-left
82
+ border-color
83
+ border-image
84
+ border-top-color
85
+ border-right-color
86
+ border-bottom-color
87
+ border-left-color
88
+ border-spacing
89
+ border-style
90
+ border-top-style
91
+ border-right-style
92
+ border-bottom-style
93
+ border-left-style
94
+ border-width
95
+ border-top-width
96
+ border-right-width
97
+ border-bottom-width
98
+ border-left-width
99
+ border-radius
100
+ border-top-right-radius
101
+ border-bottom-right-radius
102
+ border-bottom-left-radius
103
+ border-top-left-radius
104
+ border-radius-topright
105
+ border-radius-bottomright
106
+ border-radius-bottomleft
107
+ border-radius-topleft
108
+ content
109
+ quotes
110
+ outline
111
+ outline-offset
112
+ opacity
113
+ filter
114
+ visibility
115
+ size
116
+ zoom
117
+ transform
118
+ box-align
119
+ box-flex
120
+ box-orient
121
+ box-pack
122
+ box-shadow
123
+ box-sizing
124
+ table-layout
125
+ animation
126
+ animation-delay
127
+ animation-duration
128
+ animation-iteration-count
129
+ animation-name
130
+ animation-play-state
131
+ animation-timing-function
132
+ animation-fill-mode
133
+ transition
134
+ transition-delay
135
+ transition-duration
136
+ transition-property
137
+ transition-timing-function
138
+ background-clip
139
+ backface-visibility
140
+ resize
141
+ appearance
142
+ user-select
143
+ interpolation-mode
144
+ direction
145
+ marks
146
+ page
147
+ set-link-source
148
+ unicode-bidi
149
+ speak
@@ -0,0 +1,137 @@
1
+ # SMACSS Property Order
2
+ # http://smacss.com/book/formatting
3
+
4
+ # Box
5
+
6
+ display
7
+ position
8
+ top
9
+ right
10
+ bottom
11
+ left
12
+
13
+ width
14
+ min-width
15
+ max-width
16
+
17
+ height
18
+ min-height
19
+ max-height
20
+
21
+ margin
22
+ margin-top
23
+ margin-right
24
+ margin-bottom
25
+ margin-left
26
+
27
+ padding
28
+ padding-top
29
+ padding-right
30
+ padding-bottom
31
+ padding-left
32
+
33
+ float
34
+ clear
35
+
36
+ columns
37
+ column-gap
38
+ column-fill
39
+ column-rule
40
+ column-span
41
+ column-count
42
+ column-width
43
+
44
+ transform
45
+ transition
46
+
47
+ # Border
48
+
49
+ border
50
+ border-top
51
+ border-right
52
+ border-bottom
53
+ border-left
54
+ border-width
55
+ border-top-width
56
+ border-right-width
57
+ border-bottom-width
58
+ border-left-width
59
+
60
+ border-style
61
+ border-top-style
62
+ border-right-style
63
+ border-bottom-style
64
+ border-left-style
65
+
66
+ border-radius
67
+ border-top-left-radius
68
+ border-top-right-radius
69
+ border-bottom-left-radius
70
+ border-bottom-right-radius
71
+
72
+ border-color
73
+ border-top-color
74
+ border-right-color
75
+ border-bottom-color
76
+ border-left-color
77
+
78
+ outline
79
+ outline-color
80
+ outline-offset
81
+ outline-style
82
+ outline-width
83
+
84
+ # Background
85
+
86
+ background
87
+ background-color
88
+ background-image
89
+ background-repeat
90
+ background-position
91
+ background-size
92
+
93
+ # Text
94
+
95
+ color
96
+
97
+ font
98
+ font-family
99
+ font-size
100
+ font-smoothing
101
+ font-style
102
+ font-variant
103
+ font-weight
104
+
105
+ letter-spacing
106
+ line-height
107
+ list-style
108
+
109
+ text-align
110
+ text-decoration
111
+ text-indent
112
+ text-overflow
113
+ text-rendering
114
+ text-shadow
115
+ text-transform
116
+ text-wrap
117
+
118
+ white-space
119
+ word-spacing
120
+
121
+ # Other
122
+
123
+ border-collapse
124
+ border-spacing
125
+ box-shadow
126
+ caption-side
127
+ content
128
+ cursor
129
+ empty-cells
130
+ opacity
131
+ overflow
132
+ quotes
133
+ speak
134
+ table-layout
135
+ vertical-align
136
+ visibility
137
+ z-index
data/lib/scss_lint.rb ADDED
@@ -0,0 +1,31 @@
1
+ require 'scss_lint/constants'
2
+ require 'scss_lint/exceptions'
3
+ require 'scss_lint/config'
4
+ require 'scss_lint/engine'
5
+ require 'scss_lint/location'
6
+ require 'scss_lint/lint'
7
+ require 'scss_lint/linter_registry'
8
+ require 'scss_lint/file_finder'
9
+ require 'scss_lint/runner'
10
+ require 'scss_lint/selector_visitor'
11
+ require 'scss_lint/control_comment_processor'
12
+ require 'scss_lint/version'
13
+ require 'scss_lint/utils'
14
+
15
+ # Load Sass classes and then monkey patch them
16
+ require 'sass'
17
+ require File.expand_path('scss_lint/sass/script', File.dirname(__FILE__))
18
+ require File.expand_path('scss_lint/sass/tree', File.dirname(__FILE__))
19
+
20
+ # Load all linters in sorted order, since ordering matters and some systems
21
+ # return the files in an order which loads a child class before the parent.
22
+ require 'scss_lint/linter'
23
+ Dir[File.expand_path('scss_lint/linter/**/*.rb', File.dirname(__FILE__))].sort.each do |file|
24
+ require file
25
+ end
26
+
27
+ # Load all reporters
28
+ require 'scss_lint/reporter'
29
+ Dir[File.expand_path('scss_lint/reporter/**/*.rb', File.dirname(__FILE__))].sort.each do |file|
30
+ require file
31
+ end