platformos-check 0.4.12 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/CONTRIBUTING.md +20 -18
  4. data/README.md +108 -57
  5. data/RELEASING.md +14 -7
  6. data/TROUBLESHOOTING.md +19 -10
  7. data/data/platformos_liquid/documentation/filters.json +1 -1
  8. data/data/platformos_liquid/documentation/latest.json +1 -1
  9. data/data/platformos_liquid/documentation/tags.json +1 -1
  10. data/docs/api/check.md +7 -6
  11. data/docs/api/html_check.md +12 -13
  12. data/docs/api/liquid_check.md +17 -21
  13. data/docs/api/yaml_check.md +3 -3
  14. data/docs/checks/TEMPLATE.md.erb +16 -11
  15. data/docs/checks/convert_include_to_render.md +29 -13
  16. data/docs/checks/deprecated_filter.md +5 -9
  17. data/docs/checks/form_action.md +12 -12
  18. data/docs/checks/form_authenticity_token.md +21 -15
  19. data/docs/checks/graphql_in_for_loop.md +15 -13
  20. data/docs/checks/html_parsing_error.md +12 -12
  21. data/docs/checks/img_lazy_loading.md +13 -11
  22. data/docs/checks/img_width_and_height.md +21 -23
  23. data/docs/checks/include_in_render.md +11 -11
  24. data/docs/checks/invalid_args.md +11 -11
  25. data/docs/checks/liquid_tag.md +12 -12
  26. data/docs/checks/missing_enable_comment.md +7 -7
  27. data/docs/checks/missing_template.md +14 -13
  28. data/docs/checks/parse_json_format.md +15 -14
  29. data/docs/checks/parser_blocking_javascript.md +19 -14
  30. data/docs/checks/required_layout_object.md +5 -7
  31. data/docs/checks/space_inside_braces.md +12 -12
  32. data/docs/checks/syntax_error.md +10 -10
  33. data/docs/checks/template_length.md +12 -12
  34. data/docs/checks/translation_files_match.md +10 -11
  35. data/docs/checks/translation_key_exists.md +10 -11
  36. data/docs/checks/undefined_object.md +11 -13
  37. data/docs/checks/unknown_filter.md +11 -11
  38. data/docs/checks/unreachable_code.md +11 -11
  39. data/docs/checks/unused_assign.md +11 -11
  40. data/docs/checks/unused_partial.md +7 -11
  41. data/docs/checks/valid_yaml.md +11 -11
  42. data/docs/language_server/how_to_correct_code_with_code_actions_and_execute_command.md +62 -70
  43. data/lib/platformos_check/language_server/handler.rb +6 -6
  44. data/lib/platformos_check/language_server/variable_lookup_finder.rb +8 -10
  45. data/lib/platformos_check/platformos_liquid/documentation.rb +2 -2
  46. data/lib/platformos_check/version.rb +1 -1
  47. data/platformos-check.gemspec +1 -1
  48. metadata +5 -5
@@ -169,8 +169,8 @@ module PlatformosCheck
169
169
 
170
170
  def on_workspace_did_create_files(_id, params)
171
171
  paths = params[:files]
172
- &.map { |file| file[:uri] }
173
- &.map { |uri| file_path(uri) }
172
+ &.map { |file| file[:uri] }
173
+ &.map { |uri| file_path(uri) }
174
174
  return unless paths
175
175
 
176
176
  paths.each do |path|
@@ -184,8 +184,8 @@ module PlatformosCheck
184
184
 
185
185
  def on_workspace_did_delete_files(_id, params)
186
186
  absolute_paths = params[:files]
187
- &.map { |file| file[:uri] }
188
- &.map { |uri| file_path(uri) }
187
+ &.map { |file| file[:uri] }
188
+ &.map { |uri| file_path(uri) }
189
189
 
190
190
  return unless absolute_paths
191
191
 
@@ -202,8 +202,8 @@ module PlatformosCheck
202
202
  # (which might trigger another platformos_app analysis).
203
203
  def on_workspace_will_rename_files(id, params)
204
204
  relative_paths = params[:files]
205
- &.map { |file| [file[:oldUri], file[:newUri]] }
206
- &.map { |(old_uri, new_uri)| [relative_path_from_uri(old_uri), relative_path_from_uri(new_uri)] }
205
+ &.map { |file| [file[:oldUri], file[:newUri]] }
206
+ &.map { |(old_uri, new_uri)| [relative_path_from_uri(old_uri), relative_path_from_uri(new_uri)] }
207
207
  return @bridge.send_response(id, nil) unless relative_paths
208
208
 
209
209
  relative_paths.each do |(old_path, new_path)|
@@ -75,11 +75,10 @@ module PlatformosCheck
75
75
  is_liquid_variable = content =~ Liquid::VariableStart
76
76
  is_in_variable_segment = previous_char =~ VARIABLE_LOOKUP_CHARACTERS
77
77
  is_on_blank_variable_lookup_position = content[0..cursor - 1] =~ /[{:,-]\s+$/
78
- (
79
- is_liquid_variable && (
80
- is_in_variable_segment ||
81
- is_on_blank_variable_lookup_position
82
- )
78
+
79
+ is_liquid_variable && (
80
+ is_in_variable_segment ||
81
+ is_on_blank_variable_lookup_position
83
82
  )
84
83
  end
85
84
 
@@ -162,11 +161,10 @@ module PlatformosCheck
162
161
  is_liquid_tag = content.match?(Liquid::TagStart)
163
162
  is_in_variable_segment = markup =~ ENDS_WITH_POTENTIAL_LOOKUP
164
163
  is_on_blank_variable_lookup_position = markup =~ ENDS_WITH_BLANK_POTENTIAL_LOOKUP
165
- (
166
- is_liquid_tag && (
167
- is_in_variable_segment ||
168
- is_on_blank_variable_lookup_position
169
- )
164
+
165
+ is_liquid_tag && (
166
+ is_in_variable_segment ||
167
+ is_on_blank_variable_lookup_position
170
168
  )
171
169
  end
172
170
 
@@ -22,8 +22,8 @@ module PlatformosCheck
22
22
  property_entry = SourceIndex
23
23
  .objects
24
24
  .find { |entry| entry.name == object_name }
25
- &.properties
26
- &.find { |prop| prop.name == property_name }
25
+ &.properties
26
+ &.find { |prop| prop.name == property_name }
27
27
 
28
28
  render_doc(property_entry)
29
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlatformosCheck
4
- VERSION = "0.4.12"
4
+ VERSION = "0.4.13"
5
5
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency('graphql', '~> 2.0.0')
31
- spec.add_dependency('liquid', '>= 5.4.0')
31
+ spec.add_dependency('liquid', '5.4.0')
32
32
  spec.add_dependency('nokogiri', '>= 1.12')
33
33
  spec.add_dependency('parser', '~> 3')
34
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platformos-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.12
4
+ version: 0.4.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Bliszczyk
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2024-04-13 00:00:00.000000000 Z
13
+ date: 2024-10-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: graphql
@@ -30,14 +30,14 @@ dependencies:
30
30
  name: liquid
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - '='
34
34
  - !ruby/object:Gem::Version
35
35
  version: 5.4.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - '='
41
41
  - !ruby/object:Gem::Version
42
42
  version: 5.4.0
43
43
  - !ruby/object:Gem::Dependency
@@ -373,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  - !ruby/object:Gem::Version
374
374
  version: '0'
375
375
  requirements: []
376
- rubygems_version: 3.5.7
376
+ rubygems_version: 3.5.18
377
377
  signing_key:
378
378
  specification_version: 4
379
379
  summary: A platformOS App Linter