theme-check 1.10.3 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/cla.yml +22 -0
- data/.github/workflows/theme-check.yml +1 -1
- data/.gitignore +3 -0
- data/CHANGELOG.md +48 -0
- data/CONTRIBUTING.md +82 -0
- data/README.md +11 -8
- data/Rakefile +7 -0
- data/TROUBLESHOOTING.md +65 -0
- data/config/default.yml +4 -0
- data/data/shopify_liquid/built_in_liquid_objects.json +60 -0
- data/data/shopify_liquid/documentation/filters.json +5528 -0
- data/data/shopify_liquid/documentation/latest.json +1 -0
- data/data/shopify_liquid/documentation/objects.json +19272 -0
- data/data/shopify_liquid/documentation/tags.json +1252 -0
- data/data/shopify_liquid/filters.yml +18 -0
- data/dev.yml +1 -1
- data/docs/checks/asset_preload.md +60 -0
- data/docs/checks/asset_size_javascript.md +2 -2
- data/docs/checks/missing_enable_comment.md +3 -3
- data/docs/checks/nested_snippet.md +8 -8
- data/docs/checks/translation_key_exists.md +4 -4
- data/docs/checks/valid_html_translation.md +1 -1
- data/lib/theme_check/analyzer.rb +18 -3
- data/lib/theme_check/check.rb +6 -1
- data/lib/theme_check/checks/asset_preload.rb +20 -0
- data/lib/theme_check/checks/deprecated_filter.rb +29 -5
- data/lib/theme_check/checks/missing_enable_comment.rb +4 -0
- data/lib/theme_check/checks/missing_required_template_files.rb +5 -1
- data/lib/theme_check/checks/missing_template.rb +5 -1
- data/lib/theme_check/checks/undefined_object.rb +4 -0
- data/lib/theme_check/checks/unused_assign.rb +6 -1
- data/lib/theme_check/checks/unused_snippet.rb +50 -2
- data/lib/theme_check/config.rb +2 -2
- data/lib/theme_check/disabled_checks.rb +11 -4
- data/lib/theme_check/file_system_storage.rb +2 -0
- data/lib/theme_check/in_memory_storage.rb +1 -1
- data/lib/theme_check/language_server/bridge.rb +31 -6
- data/lib/theme_check/language_server/completion_context.rb +52 -0
- data/lib/theme_check/language_server/completion_engine.rb +15 -21
- data/lib/theme_check/language_server/completion_provider.rb +16 -1
- data/lib/theme_check/language_server/completion_providers/assignments_completion_provider.rb +36 -0
- data/lib/theme_check/language_server/completion_providers/filter_completion_provider.rb +49 -6
- data/lib/theme_check/language_server/completion_providers/object_attribute_completion_provider.rb +47 -0
- data/lib/theme_check/language_server/completion_providers/object_completion_provider.rb +10 -7
- data/lib/theme_check/language_server/completion_providers/render_snippet_completion_provider.rb +5 -1
- data/lib/theme_check/language_server/completion_providers/tag_completion_provider.rb +8 -1
- data/lib/theme_check/language_server/diagnostics_engine.rb +80 -34
- data/lib/theme_check/language_server/diagnostics_manager.rb +27 -6
- data/lib/theme_check/language_server/execute_command_providers/run_checks_execute_command_provider.rb +7 -6
- data/lib/theme_check/language_server/handler.rb +93 -9
- data/lib/theme_check/language_server/protocol.rb +9 -0
- data/lib/theme_check/language_server/server.rb +42 -14
- data/lib/theme_check/language_server/type_helper.rb +22 -0
- data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/node_handler.rb +63 -0
- data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb +57 -0
- data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb +42 -0
- data/lib/theme_check/language_server/variable_lookup_finder/assignments_finder.rb +76 -0
- data/lib/theme_check/language_server/variable_lookup_finder/constants.rb +43 -0
- data/lib/theme_check/language_server/variable_lookup_finder/liquid_fixer.rb +103 -0
- data/lib/theme_check/language_server/variable_lookup_finder/potential_lookup.rb +10 -0
- data/lib/theme_check/language_server/variable_lookup_finder/tolerant_parser.rb +94 -0
- data/lib/theme_check/language_server/variable_lookup_finder.rb +60 -100
- data/lib/theme_check/language_server/variable_lookup_traverser.rb +70 -0
- data/lib/theme_check/language_server/versioned_in_memory_storage.rb +17 -2
- data/lib/theme_check/language_server.rb +12 -0
- data/lib/theme_check/liquid_file.rb +22 -1
- data/lib/theme_check/liquid_node.rb +33 -1
- data/lib/theme_check/liquid_visitor.rb +1 -1
- data/lib/theme_check/remote_asset_file.rb +13 -7
- data/lib/theme_check/schema_helper.rb +1 -1
- data/lib/theme_check/shopify_liquid/documentation/markdown_template.rb +51 -0
- data/lib/theme_check/shopify_liquid/documentation.rb +44 -0
- data/lib/theme_check/shopify_liquid/filter.rb +4 -0
- data/lib/theme_check/shopify_liquid/object.rb +4 -0
- data/lib/theme_check/shopify_liquid/source_index/base_entry.rb +60 -0
- data/lib/theme_check/shopify_liquid/source_index/base_state.rb +23 -0
- data/lib/theme_check/shopify_liquid/source_index/filter_entry.rb +18 -0
- data/lib/theme_check/shopify_liquid/source_index/filter_state.rb +11 -0
- data/lib/theme_check/shopify_liquid/source_index/object_entry.rb +14 -0
- data/lib/theme_check/shopify_liquid/source_index/object_state.rb +11 -0
- data/lib/theme_check/shopify_liquid/source_index/parameter_entry.rb +21 -0
- data/lib/theme_check/shopify_liquid/source_index/property_entry.rb +9 -0
- data/lib/theme_check/shopify_liquid/source_index/return_type_entry.rb +37 -0
- data/lib/theme_check/shopify_liquid/source_index/tag_entry.rb +20 -0
- data/lib/theme_check/shopify_liquid/source_index/tag_state.rb +11 -0
- data/lib/theme_check/shopify_liquid/source_index.rb +56 -0
- data/lib/theme_check/shopify_liquid/source_manager.rb +111 -0
- data/lib/theme_check/shopify_liquid/tag.rb +4 -0
- data/lib/theme_check/shopify_liquid.rb +17 -1
- data/lib/theme_check/tags.rb +2 -1
- data/lib/theme_check/version.rb +1 -1
- data/shipit.rubygems.yml +3 -0
- data/theme-check.gemspec +5 -3
- metadata +45 -6
- data/.github/probots.yml +0 -3
@@ -1,6 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_relative 'shopify_liquid/deprecated_filter'
|
4
|
+
require_relative 'shopify_liquid/documentation'
|
3
5
|
require_relative 'shopify_liquid/filter'
|
4
6
|
require_relative 'shopify_liquid/object'
|
5
|
-
require_relative 'shopify_liquid/
|
7
|
+
require_relative 'shopify_liquid/source_manager'
|
8
|
+
require_relative 'shopify_liquid/source_index'
|
6
9
|
require_relative 'shopify_liquid/system_translations'
|
10
|
+
require_relative 'shopify_liquid/tag'
|
11
|
+
|
12
|
+
require_relative 'shopify_liquid/source_index/base_entry'
|
13
|
+
require_relative 'shopify_liquid/source_index/filter_entry'
|
14
|
+
require_relative 'shopify_liquid/source_index/object_entry'
|
15
|
+
require_relative 'shopify_liquid/source_index/parameter_entry'
|
16
|
+
require_relative 'shopify_liquid/source_index/property_entry'
|
17
|
+
require_relative 'shopify_liquid/source_index/return_type_entry'
|
18
|
+
require_relative 'shopify_liquid/source_index/tag_entry'
|
19
|
+
require_relative 'shopify_liquid/source_index/base_state'
|
20
|
+
require_relative 'shopify_liquid/source_index/filter_state'
|
21
|
+
require_relative 'shopify_liquid/source_index/object_state'
|
22
|
+
require_relative 'shopify_liquid/source_index/tag_state'
|
data/lib/theme_check/tags.rb
CHANGED
@@ -145,7 +145,7 @@ module ThemeCheck
|
|
145
145
|
|
146
146
|
disable_tags "include"
|
147
147
|
|
148
|
-
attr_reader :template_name_expr, :attributes
|
148
|
+
attr_reader :template_name_expr, :variable_name_expr, :attributes
|
149
149
|
|
150
150
|
def initialize(tag_name, markup, options)
|
151
151
|
super
|
@@ -171,6 +171,7 @@ module ThemeCheck
|
|
171
171
|
def children
|
172
172
|
[
|
173
173
|
@node.template_name_expr,
|
174
|
+
@node.variable_name_expr,
|
174
175
|
] + @node.attributes.values
|
175
176
|
end
|
176
177
|
end
|
data/lib/theme_check/version.rb
CHANGED
data/shipit.rubygems.yml
ADDED
data/theme-check.gemspec
CHANGED
@@ -13,18 +13,20 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/Shopify/theme-check"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.required_ruby_version = ">= 2.
|
16
|
+
spec.required_ruby_version = ">= 2.7"
|
17
17
|
|
18
18
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
19
19
|
|
20
20
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
21
|
-
|
21
|
+
# Load all files tracked in git except files in test directory
|
22
|
+
# Include untracked files in liquid documentation folder
|
23
|
+
%x{git ls-files -z}.split("\x0").reject { |f| f.match(%r{^test/}) } + Dir['data/shopify_liquid/documentation/**']
|
22
24
|
end
|
23
25
|
spec.bindir = "exe"
|
24
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
27
|
spec.require_paths = ["lib"]
|
26
28
|
|
27
|
-
spec.add_dependency('liquid', '>= 5.
|
29
|
+
spec.add_dependency('liquid', '>= 5.4.0')
|
28
30
|
spec.add_dependency('nokogiri', '>= 1.12')
|
29
31
|
spec.add_dependency('parser', '~> 3')
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-André Cournoyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.
|
19
|
+
version: 5.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.
|
26
|
+
version: 5.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +61,9 @@ executables:
|
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
|
-
- ".github/
|
64
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
65
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
66
|
+
- ".github/workflows/cla.yml"
|
65
67
|
- ".github/workflows/theme-check.yml"
|
66
68
|
- ".gitignore"
|
67
69
|
- ".rubocop.yml"
|
@@ -74,12 +76,18 @@ files:
|
|
74
76
|
- README.md
|
75
77
|
- RELEASING.md
|
76
78
|
- Rakefile
|
79
|
+
- TROUBLESHOOTING.md
|
77
80
|
- bin/theme-check
|
78
81
|
- bin/theme-check-language-server
|
79
82
|
- config/default.yml
|
80
83
|
- config/nothing.yml
|
81
84
|
- config/theme_app_extension.yml
|
85
|
+
- data/shopify_liquid/built_in_liquid_objects.json
|
82
86
|
- data/shopify_liquid/deprecated_filters.yml
|
87
|
+
- data/shopify_liquid/documentation/filters.json
|
88
|
+
- data/shopify_liquid/documentation/latest.json
|
89
|
+
- data/shopify_liquid/documentation/objects.json
|
90
|
+
- data/shopify_liquid/documentation/tags.json
|
83
91
|
- data/shopify_liquid/filters.yml
|
84
92
|
- data/shopify_liquid/objects.yml
|
85
93
|
- data/shopify_liquid/plus_objects.yml
|
@@ -93,6 +101,7 @@ files:
|
|
93
101
|
- docs/api/liquid_check.md
|
94
102
|
- docs/checks/TEMPLATE.md.erb
|
95
103
|
- docs/checks/app_block_valid_tags.md
|
104
|
+
- docs/checks/asset_preload.md
|
96
105
|
- docs/checks/asset_size_app_block_css.md
|
97
106
|
- docs/checks/asset_size_app_block_javascript.md
|
98
107
|
- docs/checks/asset_size_css.md
|
@@ -153,6 +162,7 @@ files:
|
|
153
162
|
- lib/theme_check/checks.rb
|
154
163
|
- lib/theme_check/checks/TEMPLATE.rb.erb
|
155
164
|
- lib/theme_check/checks/app_block_valid_tags.rb
|
165
|
+
- lib/theme_check/checks/asset_preload.rb
|
156
166
|
- lib/theme_check/checks/asset_size_app_block_css.rb
|
157
167
|
- lib/theme_check/checks/asset_size_app_block_javascript.rb
|
158
168
|
- lib/theme_check/checks/asset_size_css.rb
|
@@ -218,10 +228,13 @@ files:
|
|
218
228
|
- lib/theme_check/language_server/code_action_provider.rb
|
219
229
|
- lib/theme_check/language_server/code_action_providers/quickfix_code_action_provider.rb
|
220
230
|
- lib/theme_check/language_server/code_action_providers/source_fix_all_code_action_provider.rb
|
231
|
+
- lib/theme_check/language_server/completion_context.rb
|
221
232
|
- lib/theme_check/language_server/completion_engine.rb
|
222
233
|
- lib/theme_check/language_server/completion_helper.rb
|
223
234
|
- lib/theme_check/language_server/completion_provider.rb
|
235
|
+
- lib/theme_check/language_server/completion_providers/assignments_completion_provider.rb
|
224
236
|
- lib/theme_check/language_server/completion_providers/filter_completion_provider.rb
|
237
|
+
- lib/theme_check/language_server/completion_providers/object_attribute_completion_provider.rb
|
225
238
|
- lib/theme_check/language_server/completion_providers/object_completion_provider.rb
|
226
239
|
- lib/theme_check/language_server/completion_providers/render_snippet_completion_provider.rb
|
227
240
|
- lib/theme_check/language_server/completion_providers/tag_completion_provider.rb
|
@@ -247,8 +260,18 @@ files:
|
|
247
260
|
- lib/theme_check/language_server/protocol.rb
|
248
261
|
- lib/theme_check/language_server/server.rb
|
249
262
|
- lib/theme_check/language_server/tokens.rb
|
263
|
+
- lib/theme_check/language_server/type_helper.rb
|
250
264
|
- lib/theme_check/language_server/uri_helper.rb
|
251
265
|
- lib/theme_check/language_server/variable_lookup_finder.rb
|
266
|
+
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder.rb
|
267
|
+
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder/node_handler.rb
|
268
|
+
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope.rb
|
269
|
+
- lib/theme_check/language_server/variable_lookup_finder/assignments_finder/scope_visitor.rb
|
270
|
+
- lib/theme_check/language_server/variable_lookup_finder/constants.rb
|
271
|
+
- lib/theme_check/language_server/variable_lookup_finder/liquid_fixer.rb
|
272
|
+
- lib/theme_check/language_server/variable_lookup_finder/potential_lookup.rb
|
273
|
+
- lib/theme_check/language_server/variable_lookup_finder/tolerant_parser.rb
|
274
|
+
- lib/theme_check/language_server/variable_lookup_traverser.rb
|
252
275
|
- lib/theme_check/language_server/versioned_in_memory_storage.rb
|
253
276
|
- lib/theme_check/liquid_check.rb
|
254
277
|
- lib/theme_check/liquid_file.rb
|
@@ -268,8 +291,23 @@ files:
|
|
268
291
|
- lib/theme_check/schema_helper.rb
|
269
292
|
- lib/theme_check/shopify_liquid.rb
|
270
293
|
- lib/theme_check/shopify_liquid/deprecated_filter.rb
|
294
|
+
- lib/theme_check/shopify_liquid/documentation.rb
|
295
|
+
- lib/theme_check/shopify_liquid/documentation/markdown_template.rb
|
271
296
|
- lib/theme_check/shopify_liquid/filter.rb
|
272
297
|
- lib/theme_check/shopify_liquid/object.rb
|
298
|
+
- lib/theme_check/shopify_liquid/source_index.rb
|
299
|
+
- lib/theme_check/shopify_liquid/source_index/base_entry.rb
|
300
|
+
- lib/theme_check/shopify_liquid/source_index/base_state.rb
|
301
|
+
- lib/theme_check/shopify_liquid/source_index/filter_entry.rb
|
302
|
+
- lib/theme_check/shopify_liquid/source_index/filter_state.rb
|
303
|
+
- lib/theme_check/shopify_liquid/source_index/object_entry.rb
|
304
|
+
- lib/theme_check/shopify_liquid/source_index/object_state.rb
|
305
|
+
- lib/theme_check/shopify_liquid/source_index/parameter_entry.rb
|
306
|
+
- lib/theme_check/shopify_liquid/source_index/property_entry.rb
|
307
|
+
- lib/theme_check/shopify_liquid/source_index/return_type_entry.rb
|
308
|
+
- lib/theme_check/shopify_liquid/source_index/tag_entry.rb
|
309
|
+
- lib/theme_check/shopify_liquid/source_index/tag_state.rb
|
310
|
+
- lib/theme_check/shopify_liquid/source_manager.rb
|
273
311
|
- lib/theme_check/shopify_liquid/system_translations.rb
|
274
312
|
- lib/theme_check/shopify_liquid/tag.rb
|
275
313
|
- lib/theme_check/storage.rb
|
@@ -280,6 +318,7 @@ files:
|
|
280
318
|
- lib/theme_check/theme_file_rewriter.rb
|
281
319
|
- lib/theme_check/version.rb
|
282
320
|
- packaging/homebrew/theme_check.base.rb
|
321
|
+
- shipit.rubygems.yml
|
283
322
|
- theme-check.gemspec
|
284
323
|
homepage: https://github.com/Shopify/theme-check
|
285
324
|
licenses:
|
@@ -294,7 +333,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
294
333
|
requirements:
|
295
334
|
- - ">="
|
296
335
|
- !ruby/object:Gem::Version
|
297
|
-
version: '2.
|
336
|
+
version: '2.7'
|
298
337
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
299
338
|
requirements:
|
300
339
|
- - ">="
|
data/.github/probots.yml
DELETED