slim_lint 0.28.0 → 0.29.0

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: b7be0fb0eb28f9ecd303cae98461185de3e6778c8ac50230adf67cb5b741d432
4
- data.tar.gz: 584e97fc7dd83fa5e71aeec357e365cc5c5fd23f16d2504a7e7b62fbacb64b0e
3
+ metadata.gz: 51dd9d9778d4a2208bd188fce5919413f5ff3e3aff6deb275bd58e2a783d1fb5
4
+ data.tar.gz: dafc47104aaa6aed6cf62a02f0a21eefffd28ead98c6befaa3118ed9b1dd37d9
5
5
  SHA512:
6
- metadata.gz: 7922b5927ef482197e73669568b8dbe3c676a590f98164a52a085b5312853be43439a3fe36641301c68e5621ea6f40cefb566c523b9d6327a349a5fd5989e9cb
7
- data.tar.gz: 110fb1466b24a89d8e2868afbb8e1bb1540a575bd406a075a63a29f8d5aae28f06ec1e62512d3cb0ccd252f2e04cbabc97a8793ea9cd7ee917bb2673f4ab704a
6
+ metadata.gz: 8dfc4baf530ee352ef807a44d26b2864813f568ac407044cccdca3dc6f58bca4964f08442b757a2706a6e268b22b19b1c5b8011bbf71acd0fdb6c9a373711c20
7
+ data.tar.gz: f63580ff81d91620ee62cbf8f3ce1c0a6a792aa802e3f47ab481f08efa5ac9973bcc0b1ca5411b358776bf49107934fcbb75a6006da0a15db1f6aed98ce40ef1
data/config/default.yml CHANGED
@@ -102,6 +102,10 @@ linters:
102
102
  enabled: false
103
103
  forbidden_tags: []
104
104
 
105
+ TagAttribute:
106
+ enabled: false
107
+ forbidden_attributes: []
108
+
105
109
  TagCase:
106
110
  enabled: true
107
111
 
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SlimLint
4
+ # Checks for forbidden tag attributes.
5
+ class Linter::TagAttribute < Linter
6
+ include LinterRegistry
7
+
8
+ on [:html, :attr] do |sexp|
9
+ _, _, name = sexp
10
+
11
+ forbidden_attributes = config['forbidden_attributes']
12
+ forbidden_attributes.each do |forbidden_attribute|
13
+ next unless name[/^#{forbidden_attribute}$/i]
14
+
15
+ report_lint(sexp, "Forbidden tag attribute `#{name}` found")
16
+ end
17
+ end
18
+ end
19
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module SlimLint
5
- VERSION = '0.28.0'
5
+ VERSION = '0.29.0'
6
6
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0
4
+ version: 0.29.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: 2024-08-31 00:00:00.000000000 Z
11
+ date: 2024-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rexml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -121,6 +135,7 @@ files:
121
135
  - lib/slim_lint/linter/strict_locals_missing.rb
122
136
  - lib/slim_lint/linter/tab.rb
123
137
  - lib/slim_lint/linter/tag.rb
138
+ - lib/slim_lint/linter/tag_attribute.rb
124
139
  - lib/slim_lint/linter/tag_case.rb
125
140
  - lib/slim_lint/linter/trailing_blank_lines.rb
126
141
  - lib/slim_lint/linter/trailing_whitespace.rb