theme-check 1.1.0 → 1.2.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: adc4aaf3260408a9b52d9afaa59662308f173a5d5dcd0f3663cbcc68da1d7f39
4
- data.tar.gz: 50cd7e0d42fda99ad3816a846c25868c38b92ea521e0be759c515548dd82f70b
3
+ metadata.gz: 28cb25e47867151bea85360a9f07667f46ea30ad90285f16cc74e85370ad39d9
4
+ data.tar.gz: 2023811dad002a72f00e2c26562ff3e6b5f2f49c748d44968fd94d1f9e72300f
5
5
  SHA512:
6
- metadata.gz: 7ffad3310e441edd678143de233584a09167ffff1e09b96109cef417d360d797821dc9ef3491af4564608cd3b35aa59be41ebea6bb76030e1544d53bc9db8d02
7
- data.tar.gz: 30b6d8f3b58b95c833a78bc30ceea6cfcfa35d563e3d184b6aee51817965be87b352c2dbad5ff67a74f2a64479fe1945c11db738c1bfb6e64f610ae15b862cb3
6
+ metadata.gz: f3a5339873aea7a325cbc3f3715e9166b1f7734226e3d9ac7b400f048629a514f3eec5d559c77eaf70febacda35416b8332d8d1a6ebefa1d9a34f29474a4e41d
7
+ data.tar.gz: 19eec11d1eb86188fe170bce61f884072340d848e800b2bb2b344cddf3561d60594e4f066199b7f9157b54da81ce8afebc5e6db0f3dbfbc5fac208c95d2b5ed8
@@ -1,10 +1,6 @@
1
1
  name: ThemeCheck
2
2
 
3
- on:
4
- push:
5
- branches: [ master ]
6
- pull_request:
7
- branches: [ master ]
3
+ on: [push]
8
4
 
9
5
  jobs:
10
6
  test:
@@ -36,4 +32,4 @@ jobs:
36
32
  run: bundle exec rake
37
33
  - name: Test runtime
38
34
  # Testing that runtime can execute, not testing the results themselves
39
- run: bundle exec theme-check ./test/theme | grep -q "files inspected"
35
+ run: bundle exec theme-check ./test/theme | grep -q "files inspected"
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ v1.2.0 / 2021-07-15
3
+ ==================
4
+
5
+ * Add Windows Support ([#364](https://github.com/shopify/theme-check/issues/364))
6
+ * Ignore empty `{{}}` in SpaceInsideBraces ([#350](https://github.com/shopify/theme-check/issues/350))
7
+ * Switch to main branch
8
+ * Minor documentation fixes
9
+
2
10
  v1.1.0 / 2021-07-06
3
11
  ==================
4
12
 
data/RELEASING.md CHANGED
@@ -13,7 +13,14 @@
13
13
 
14
14
  4. Commit your changes and make a PR.
15
15
 
16
- 5. Merge your PR to master.
16
+ ```bash
17
+ git checkout -b "bump/theme-check-$VERSION"
18
+ git add docs/checks CHANGELOG.md lib/theme_check/version.rb
19
+ git commit -m "Bump theme-check version to $VERSION"
20
+ hub compare "main:bump/theme-check-$VERSION"
21
+ ```
22
+
23
+ 5. Merge your PR to main.
17
24
 
18
25
  6. On [Shipit](https://shipit.shopify.io/shopify/theme-check/rubygems), deploy your commit.
19
26
 
@@ -46,5 +53,30 @@
46
53
 
47
54
  ```bash
48
55
  # shortcut if you have `hub` installed
49
- hub compare "master:bump/theme-check-$VERSION"
56
+ hub compare "main:bump/theme-check-$VERSION"
57
+ ```
58
+
59
+ ## Shopify CLI Release Process
60
+
61
+ 1. Release `theme-check` on RubyGems by following the steps in the previous section.
62
+
63
+ 2. Update the `theme-check` version in [`shopify-cli`](https://github.com/shopify/shopify-cli)'s `Gemfile.lock` and `shopify-cli.gemspec` files.
64
+
65
+ Such as in [this PR.](https://github.com/Shopify/shopify-cli/pull/1357/files)
66
+
67
+ 3. Create a branch + a commit on the [`shopify-cli`](https://github.com/Shopify/shopify-cli) repository.
68
+
69
+ ```bash
70
+ VERSION=X.X.X
71
+ git checkout -b "bump/theme-check-$VERSION"
72
+ git add Gemfile.lock
73
+ git add shopify-cli.gemspec
74
+ git commit -m "Bump theme-check version to $VERSION"
75
+ ```
76
+
77
+ 4. Create a pull-request for those changes on the [`shopify-cli`](https://github.com/Shopify/shopify-cli) repository.
78
+
79
+ ```bash
80
+ # shortcut if you have `hub` installed
81
+ hub compare "main:bump/theme-check-$VERSION"
50
82
  ```
@@ -0,0 +1,3 @@
1
+ @ECHO OFF
2
+
3
+ ruby "%~dp0\theme-check-language-server" %*
@@ -0,0 +1,3 @@
1
+ @ECHO OFF
2
+
3
+ ruby "%~dp0\theme-check" %*
@@ -69,7 +69,7 @@ module ThemeCheck
69
69
  end
70
70
 
71
71
  def docs_url(path)
72
- "https://github.com/Shopify/theme-check/blob/master/docs/checks/#{File.basename(path, '.rb')}.md"
72
+ "https://github.com/Shopify/theme-check/blob/main/docs/checks/#{File.basename(path, '.rb')}.md"
73
73
  end
74
74
 
75
75
  def can_disable(disableable = nil)
@@ -51,7 +51,7 @@ module ThemeCheck
51
51
  end
52
52
 
53
53
  def on_variable(node)
54
- return if @ignore
54
+ return if @ignore || node.markup.empty?
55
55
  if node.markup[0] != " "
56
56
  add_offense("Space missing after '{{'", node: node) do |corrector|
57
57
  corrector.insert_before(node, " ")
@@ -99,7 +99,7 @@ module ThemeCheck
99
99
  end
100
100
 
101
101
  def path_from_uri(uri)
102
- uri&.sub('file://', '')
102
+ uri&.sub('file://', '')&.sub('/c%3A', '')
103
103
  end
104
104
 
105
105
  def relative_path_from_text_document_uri(params)
@@ -52,8 +52,19 @@ module ThemeCheck
52
52
  response_body = JSON.dump(response)
53
53
  log(JSON.pretty_generate(response)) if $DEBUG
54
54
 
55
- @out.write("Content-Length: #{response_body.bytesize}\r\n")
56
- @out.write("\r\n")
55
+ # Because programming is fun,
56
+ #
57
+ # Ruby on Windows turns \n into \r\n. Which means that \r\n
58
+ # gets turned into \r\r\n. Which means that the protocol
59
+ # breaks on windows unless we turn STDOUT into binary mode and
60
+ # set the encoding manually (yuk!) or we do this little hack
61
+ # here and put \n which gets transformed into \r\n on windows
62
+ # only...
63
+ #
64
+ # Hours wasted: 8.
65
+ eol = Gem.win_platform? ? "\n" : "\r\n"
66
+ @out.write("Content-Length: #{response_body.bytesize}#{eol}")
67
+ @out.write(eol)
57
68
  @out.write(response_body)
58
69
  @out.flush
59
70
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ThemeCheck
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  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.1.0
4
+ version: 1.2.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: 2021-07-06 00:00:00.000000000 Z
11
+ date: 2021-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -44,6 +44,8 @@ email:
44
44
  executables:
45
45
  - theme-check
46
46
  - theme-check-language-server
47
+ - theme-check-language-server.bat
48
+ - theme-check.bat
47
49
  extensions: []
48
50
  extra_rdoc_files: []
49
51
  files:
@@ -117,6 +119,8 @@ files:
117
119
  - docs/preview.png
118
120
  - exe/theme-check
119
121
  - exe/theme-check-language-server
122
+ - exe/theme-check-language-server.bat
123
+ - exe/theme-check.bat
120
124
  - lib/theme_check.rb
121
125
  - lib/theme_check/analyzer.rb
122
126
  - lib/theme_check/asset_file.rb