theme-check 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 534dbc983b39431842c987a200eaf768b447004cff7c0e85190b99cd110662ac
4
- data.tar.gz: 264adf54003c6284074d2e68663604e3271bff95740d08378281d18e33784d57
3
+ metadata.gz: e51f58be8347c6d602ef2f5f6385117f1c8ad5d07a66c111c8c8bf623008f3b1
4
+ data.tar.gz: 88eb1fbc392ff70251255f5aa681e6e7bf37fbc1c0a65bc1651e291c13baf5d9
5
5
  SHA512:
6
- metadata.gz: 5c9f0519436553efc0697637e7b9abc6fd5c0c82d7bf7789b802e77fdee775782a71dd41287c26cba3013ef4da21ede1226b080b083dab59411b1fc6f615df7d
7
- data.tar.gz: 6a5ba2ae76033414433d597f282f39b8785fecae7dd911a6a6d8a06f4a48d6a9094dded886f7281356483258a4fdc0b77c20c9feca0bf53b4a893b84d3fad512
6
+ metadata.gz: 0c7865cb5cb44da5811b78429d34c3309264ba21f55954a83b97784e15375798794461c0d19edfe620e8cbed45b6b8a80d63755b258505acb4c2b61bbae77e4a
7
+ data.tar.gz: 625963de20e85bc5b27989fba14a9a8243aafffc21aba5f4ea54b8e937fba05f73df99549a6b6b575dd29b7df48319c054aa2089e98c31e1e8212b1521c73c04
@@ -9,21 +9,21 @@ module ThemeCheck
9
9
  category :liquid
10
10
  doc "https://shopify.dev/docs/themes/theme-templates"
11
11
 
12
- LAYOUT_FILENAME = "layout/theme"
13
- REQUIRED_TEMPLATES_FILES = %w(index product collection cart blog article page list-collections search 404
14
- gift_card customers/account customers/activate_account customers/addresses
15
- customers/login customers/order customers/register customers/reset_password password)
12
+ REQUIRED_LIQUID_FILES = %w(layout/theme)
13
+ REQUIRED_TEMPLATE_FILES = %w(
14
+ index product collection cart blog article page list-collections search 404
15
+ gift_card customers/account customers/activate_account customers/addresses
16
+ customers/login customers/order customers/register customers/reset_password password
17
+ )
16
18
  .map { |file| "templates/#{file}" }
17
19
 
18
20
  def on_end
19
- missing_files = (REQUIRED_TEMPLATES_FILES + [LAYOUT_FILENAME]) - theme.liquid.map(&:name)
20
- missing_files.each { |file| add_missing_file_offense(file) }
21
- end
22
-
23
- private
24
-
25
- def add_missing_file_offense(file)
26
- add_offense("Theme is missing '#{file}.liquid' file")
21
+ (REQUIRED_LIQUID_FILES - theme.liquid.map(&:name)).each do |file|
22
+ add_offense("'#{file}.liquid' is missing")
23
+ end
24
+ (REQUIRED_TEMPLATE_FILES - (theme.liquid + theme.json).map(&:name)).each do |file|
25
+ add_offense("'#{file}.liquid' or '#{file}.json' is missing")
26
+ end
27
27
  end
28
28
  end
29
29
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ThemeCheck
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theme-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Cournoyer