erblint-github 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae2332b3396f7d9533f5a13c71cce75e048308f5d1ebf7a351dca556408652d2
4
- data.tar.gz: a491e50f3c4c1da08e570514bba69f11f5631c1d82a241e236269ebed1a86f0b
3
+ metadata.gz: 241e053b11c2e8e99f2393e5810b8bf9206e9db587a579c7ba20f67575f07874
4
+ data.tar.gz: 60470f738221eda4e5ee04d230cbdb63f80aa9098e87381cf75b4a6f732c4dbc
5
5
  SHA512:
6
- metadata.gz: d2e983445be5d46bdb88ffc2a8cf3be88aa09dfe1745eca84736ec98830e13b5da606c5b0022b9595b4f5c8435313267d948651d11ea6d64f465700600fcc794
7
- data.tar.gz: 31671c8e895599bf10659d9978676c532b87fed47f7deec5e977866e457a347d8c5041d029e49448a2f86348967f5aa0ce8c5ada910015bc583dd1b8b60a6d4e
6
+ metadata.gz: 267422c819129ea1e6eca8cc66ef95448345f3278cdd2ee036cc04303c8b9ef3628757808c9edc2dae815f30d56b9dceafa10670f0a60b492cb8c1df9e5254cf
7
+ data.tar.gz: 30566b29367c5991e4e6229c98f85f217467f8cbd7dd15c03a3f8f270c11da6d2439a699e9133f707d0b4a256f38e611a83e32774decbe4f35fa09647fde7d78
@@ -8,24 +8,6 @@ module ERBLint
8
8
  module CustomHelpers
9
9
  INTERACTIVE_ELEMENTS = %w[button summary input select textarea a].freeze
10
10
 
11
- def rule_disabled?(processed_source)
12
- processed_source.parser.ast.descendants(:erb).each do |node|
13
- indicator_node, _, code_node, = *node
14
- indicator = indicator_node&.loc&.source
15
- comment = code_node&.loc&.source&.strip
16
- rule_name = simple_class_name
17
-
18
- if indicator == "#" && comment.start_with?("erblint:disable") && comment.match(rule_name)
19
- if @offenses.any?
20
- clear_offenses
21
- else
22
- add_offense(processed_source.to_source_range(code_node.loc),
23
- "Unused erblint:disable comment for #{rule_name}")
24
- end
25
- end
26
- end
27
- end
28
-
29
11
  def counter_correct?(processed_source)
30
12
  comment_node = nil
31
13
  expected_count = 0
@@ -52,10 +34,10 @@ module ERBLint
52
34
  first_offense = @offenses[0]
53
35
 
54
36
  if comment_node.nil?
55
- add_offense(processed_source.to_source_range(first_offense.source_range), "#{rule_name}: If you must, add <%# erblint:counter #{rule_name} #{offenses_count} %> to bypass this check.", "<%# erblint:counter #{rule_name} #{offenses_count} %>")
37
+ add_offense(processed_source.to_source_range(first_offense.source_range), "#{rule_name}: If you must, add <%# erblint:disable #{rule_name} %> at the end of the offending line to bypass this check. See https://github.com/shopify/erb-lint#disable-rule-at-offense-level", "<%# erblint:disable #{rule_name} %>")
56
38
  else
57
39
  clear_offenses
58
- add_offense(processed_source.to_source_range(comment_node.loc), "Incorrect erblint:counter number for #{rule_name}. Expected: #{expected_count}, actual: #{offenses_count}.", "<%# erblint:counter #{rule_name} #{offenses_count} %>") if expected_count != offenses_count
40
+ add_offense(processed_source.to_source_range(comment_node.loc), "Incorrect erblint:counter number for #{rule_name}. Expected: #{expected_count}, actual: #{offenses_count}.", "<%# erblint:counter #{rule_name}Counter #{offenses_count} %>") if expected_count != offenses_count
59
41
  end
60
42
  end
61
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erblint-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source