slim_lint 0.27.0 → 0.28.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: b4318d25d9325fb30a43a2db83a14aca0002c83960dc7edb0e8a5c87eaa59e64
4
- data.tar.gz: 7ae359e3575cdae4293216064fc6a4bc0a07bd9d6ebb5b5688949634ae1ccbf1
3
+ metadata.gz: b7be0fb0eb28f9ecd303cae98461185de3e6778c8ac50230adf67cb5b741d432
4
+ data.tar.gz: 584e97fc7dd83fa5e71aeec357e365cc5c5fd23f16d2504a7e7b62fbacb64b0e
5
5
  SHA512:
6
- metadata.gz: 6a03e56f04fefa1fc83f95356bcb2bbe5b13db122140aa34afda23809cfd1af6469bed95c681436f4ec7230deebf3b7f932cbbff21423eba88b61bd107006029
7
- data.tar.gz: d59790c900df3af0486a8c4b636bf970ef9b35932e67342b3d9fb3b8a8dee779016fb0ab8d65ebcd1f9fadb26fa14149da771499159686bc665b0a56608b1774
6
+ metadata.gz: 7922b5927ef482197e73669568b8dbe3c676a590f98164a52a085b5312853be43439a3fe36641301c68e5621ea6f40cefb566c523b9d6327a349a5fd5989e9cb
7
+ data.tar.gz: 110fb1466b24a89d8e2868afbb8e1bb1540a575bd406a075a63a29f8d5aae28f06ec1e62512d3cb0ccd252f2e04cbabc97a8793ea9cd7ee917bb2673f4ab704a
data/config/default.yml CHANGED
@@ -98,6 +98,10 @@ linters:
98
98
  Tab:
99
99
  enabled: true
100
100
 
101
+ Tag:
102
+ enabled: false
103
+ forbidden_tags: []
104
+
101
105
  TagCase:
102
106
  enabled: true
103
107
 
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SlimLint
4
+ # Checks for forbidden tags.
5
+ class Linter::Tag < Linter
6
+ include LinterRegistry
7
+
8
+ on [:html, :tag] do |sexp|
9
+ _, _, name = sexp
10
+
11
+ forbidden_tags = config['forbidden_tags']
12
+ forbidden_tags.each do |forbidden_tag|
13
+ next unless name[/^#{forbidden_tag}$/i]
14
+
15
+ report_lint(sexp, "Forbidden tag `#{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.27.0'
5
+ VERSION = '0.28.0'
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.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-01 00:00:00.000000000 Z
11
+ date: 2024-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -120,6 +120,7 @@ files:
120
120
  - lib/slim_lint/linter/rubocop.rb
121
121
  - lib/slim_lint/linter/strict_locals_missing.rb
122
122
  - lib/slim_lint/linter/tab.rb
123
+ - lib/slim_lint/linter/tag.rb
123
124
  - lib/slim_lint/linter/tag_case.rb
124
125
  - lib/slim_lint/linter/trailing_blank_lines.rb
125
126
  - lib/slim_lint/linter/trailing_whitespace.rb
@@ -151,7 +152,7 @@ homepage: https://github.com/sds/slim-lint
151
152
  licenses:
152
153
  - MIT
153
154
  metadata: {}
154
- post_install_message:
155
+ post_install_message:
155
156
  rdoc_options: []
156
157
  require_paths:
157
158
  - lib
@@ -166,8 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0'
168
169
  requirements: []
169
- rubygems_version: 3.0.3.1
170
- signing_key:
170
+ rubygems_version: 3.5.9
171
+ signing_key:
171
172
  specification_version: 4
172
173
  summary: Slim template linting tool
173
174
  test_files: []