erblint-github 0.0.8 → 0.0.9

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: 5d08f8a3f7dd601469444626fb19413c9e249f7b1a5cc7d2f71416fdb1c05d85
4
- data.tar.gz: b0e6eda49feea5b68a77c975160ea2a4690e74a7d5d4b44d3b1c2ff400487ab6
3
+ metadata.gz: cfd39a72bcefe35b0231242045b4aca7cfdf6468b795d2703528655039b9e7be
4
+ data.tar.gz: 4331758cf201fe621f5510554766a6d300f46b43ef36d272e82f53d2ffaf420d
5
5
  SHA512:
6
- metadata.gz: 6e733cebcb4af6a1e3198b58db3df7fd01b8f0d57379da7c0b02f5c4c8f87f24f56462d7badcc2d4029a7e60508a7bc60c40f8312742093318b5c6013948e0ca
7
- data.tar.gz: 40868f41b146bc4c534266e270495bbebf08c77208ea9894df13105dab4311ddeb7a238881535337a123ec0b69d1f81fa8155b3f3c81b6181dbfd95066e5d0cb
6
+ metadata.gz: ea54a4d64005d7be039a3f9ed620447ca673db7113e821f303cce4c35da74835c6f124afa84f3b7e8eb35e2adb278394aef1f6326a10f73ebfb3a9a342c956a1
7
+ data.tar.gz: 942f3526203855f2a58c37f54b5d2775cc0de910a0adf057889dba2c4e60a1553276b640c7ba6c8fd6ed91d3b3af597ab86c0aa49e84f49ed47005feafcec59a
@@ -112,12 +112,17 @@ module ERBLint
112
112
 
113
113
  private
114
114
 
115
+ # Downcase and strip punctuation and extra whitespaces.
116
+ def stripped_text(text)
117
+ text.downcase.gsub(/\W+/, " ").strip
118
+ end
119
+
115
120
  def banned_text?(text)
116
- BANNED_GENERIC_TEXT.map(&:downcase).include?(text.downcase.gsub(/\W+/, " ").strip)
121
+ BANNED_GENERIC_TEXT.map(&:downcase).include?(stripped_text(text))
117
122
  end
118
123
 
119
124
  def valid_accessible_name?(aria_label, text)
120
- aria_label.downcase.include?(text.downcase)
125
+ stripped_text(aria_label).include?(stripped_text(text))
121
126
  end
122
127
 
123
128
  def extract_ruby_node(source)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erblint-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-30 00:00:00.000000000 Z
11
+ date: 2022-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erb_lint