erblint-github 0.3.0 → 0.3.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: 6b2a29a79e8d05ae92a33bff53b8a210d3ae35658e4e331fb3f7b7c9ca259147
4
- data.tar.gz: 6e551b63af42992248a0b1965e50d9954c44e3596bc5feed0ba6a2eb7399d1bf
3
+ metadata.gz: 625ce68b5e4d109bc1ddc27921ba6fc52d0d27fab2b23b9ebed9f0af92d1a523
4
+ data.tar.gz: '08302ed91e755eea56d05d7d1fb7d30403929f7cb943e7042b0ae43ecfb137f6'
5
5
  SHA512:
6
- metadata.gz: 62bd97d7ece9d2d9082d1424e086b542f25a5b736ee7664636811376cd87b08c2420cbb1c3fef0ab0b769511c6e520d8769c51380647a373efa95b241d8db393
7
- data.tar.gz: a8c9be52a3b99be842df8b5d34388f3ee8ff2629e369deaaefdea206520440a1e3a5fc18e1a74b5fa2fd774ffd2a6586476ad8dbfb965a3ea9b8dd5dd053b099
6
+ metadata.gz: 15b5b10a2edd73c90f01a3e803dceee6f2afccf38c2810b4e70327f5b88ffa6d0d0ee4570e5aa190fa6483fcd3d0ee34924b391b4e390ccba2b4ca86319493e4
7
+ data.tar.gz: 50d4c0c8f6059ed88b66b08d6c4ccbe6e795087ffee0bc5a3fc45327ddacc750178317c355a8e742f0aa2f0d4024b3ce19c00bc9e5eed4408ef20470211f387b
@@ -57,7 +57,7 @@ module ERBLint
57
57
 
58
58
  def possible_attribute_values(tag, attr_name)
59
59
  value = tag.attributes[attr_name]&.value || nil
60
- basic_conditional_code_check(value || "") || [value].compact
60
+ [value].compact
61
61
  end
62
62
 
63
63
  # Map possible values from condition
@@ -10,7 +10,7 @@ module ERBLint
10
10
  include ERBLint::Linters::CustomHelpers
11
11
  include LinterRegistry
12
12
 
13
- MESSAGE = "[aria-label] text should be formatted the same as you would visual text. Use sentence case."
13
+ MESSAGE = "[aria-label] text should be formatted the same as you would visual text. Use sentence case, and don't format it like an ID. Additionally, `aria-label` should be concise and should not contain line breaks."
14
14
 
15
15
  class ConfigSchema < LinterConfig
16
16
  property :exceptions, accepts: array_of?(String),
@@ -23,9 +23,8 @@ module ERBLint
23
23
  next if tag.closing?
24
24
 
25
25
  aria_label = possible_attribute_values(tag, "aria-label").join
26
- next if aria_label.empty?
27
26
 
28
- if aria_label.match?(/^[a-z]/) && !@config.exceptions.include?(aria_label)
27
+ if (aria_label.start_with?(/^[a-z]/) || aria_label.match?(/[\r\n]+/)) && !@config.exceptions.include?(aria_label)
29
28
  generate_offense(self.class, processed_source, tag)
30
29
  end
31
30
  end
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.3.0
4
+ version: 0.3.1
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: 2023-04-12 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erb_lint