This repository was archived by the owner on Jul 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def offenses_by_path(offenses)
2525 styleCount : path_offenses . count { |offense | offense [ :severity ] == Check ::SEVERITY_VALUES [ :style ] } ,
2626 }
2727 end
28- . sort_by { |o | o [ :path ] }
28+ . sort_by { |o | o [ :path ] || Pathname . new ( '' ) }
2929 end
3030 end
3131end
Original file line number Diff line number Diff line change @@ -25,13 +25,20 @@ def test_check_format_json
2525 {% assign x = 1 %}
2626 {% assign y = 2 %}
2727 LIQUID
28+ "config/placeholder" => '' ,
29+ "assets/placeholder" => '' ,
30+ "locales/placeholder" => '' ,
31+ "snippets/example.liquid" => '' ,
2832 "templates/example.liquid" => <<~LIQUID ,
2933 {% assign z = 1 %}
3034 LIQUID
3135 ".theme-check.yml" => <<~YAML ,
3236 extends: :nothing
3337 UnusedAssign:
3438 enabled: true
39+ RequiredDirectories:
40+ enabled: true
41+ severity: suggestion
3542 YAML
3643 )
3744
@@ -41,6 +48,23 @@ def test_check_format_json
4148
4249 assert_equal (
4350 JSON . dump ( [
51+ {
52+ "path" => nil ,
53+ "offenses" => [
54+ {
55+ "check" => "RequiredDirectories" ,
56+ "severity" => 1 ,
57+ "start_row" => 0 ,
58+ "start_column" => 0 ,
59+ "end_row" => 0 ,
60+ "end_column" => 0 ,
61+ "message" => "Theme is missing 'sections' directory" ,
62+ } ,
63+ ] ,
64+ "errorCount" => 0 ,
65+ "suggestionCount" => 1 ,
66+ "styleCount" => 0 ,
67+ } ,
4468 {
4569 "path" => "layout/theme.liquid" ,
4670 "offenses" => [
You can’t perform that action at this time.
0 commit comments