slim_lint 0.8.3 → 0.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03b2bbb8064bb228a17a89e11171205bf0ffb8d2
4
- data.tar.gz: 4207e3aee6958ba4e3b9adc659d48bb08bc8fb04
3
+ metadata.gz: b88c33d3d208586c5fe13ae31701e89225353ac1
4
+ data.tar.gz: 9d05e6492ee5182ecda6684fbd1096cf257a26be
5
5
  SHA512:
6
- metadata.gz: b5d772315b34a3b6f4156846ff0dd15dc54558e240865a60542370cfb8b5abe3123bb5484ac280340c768e1f48cecbe9946726a43135c2b58fe431fed3acbce8
7
- data.tar.gz: e80376d3c7922fcc494626aefaa6fd574d82bacf340e71443092d629c7eb978998e4b688306c2887b553f5c469d01cfcdb0069045891434858895051d8919d85
6
+ metadata.gz: 84766cad5ec40037d1c93d1858b8309532a6f0caa3d62f5cccde0fc0e8c65b0c09e52edc664830a895cbe2fb3a809e6513ddeb343f44b6356d1df81f71c613bc
7
+ data.tar.gz: 1f205711a218c38daf0bec5808c4430464274993304d5c47bc087ff3610fbc9b3fde16387c2867e2ddb2525f41629727bf7e48e5da0abce6e802751d3e82a8d4
data/config/default.yml CHANGED
@@ -58,6 +58,9 @@ linters:
58
58
  - Style/TrailingWhitespace
59
59
  - Style/WhileUntilModifier
60
60
 
61
+ Tab:
62
+ enabled: true
63
+
61
64
  TagCase:
62
65
  enabled: true
63
66
 
@@ -44,7 +44,7 @@ module SlimLint
44
44
  @source_lines = @source.split("\n")
45
45
 
46
46
  engine = SlimLint::Engine.new(file: @file)
47
- @sexp = engine.parse(source)
47
+ @sexp = engine.parse(@source)
48
48
  end
49
49
 
50
50
  # Ensure the string's encoding is valid.
@@ -0,0 +1,17 @@
1
+ module SlimLint
2
+ # Searches for tab indentation
3
+ class Linter::Tab < Linter
4
+ include LinterRegistry
5
+
6
+ MSG = 'Tab detected'.freeze
7
+
8
+ on_start do |_sexp|
9
+ dummy_node = Struct.new(:line)
10
+ document.source_lines.each_with_index do |line, index|
11
+ next unless line =~ /^( *)[\t ]*\t/
12
+
13
+ report_lint(dummy_node.new(index + 1), MSG)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SlimLint
5
- VERSION = '0.8.3'.freeze
5
+ VERSION = '0.9.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slim
@@ -135,6 +135,7 @@ files:
135
135
  - lib/slim_lint/linter/line_length.rb
136
136
  - lib/slim_lint/linter/redundant_div.rb
137
137
  - lib/slim_lint/linter/rubocop.rb
138
+ - lib/slim_lint/linter/tab.rb
138
139
  - lib/slim_lint/linter/tag_case.rb
139
140
  - lib/slim_lint/linter/trailing_whitespace.rb
140
141
  - lib/slim_lint/linter_registry.rb