rubocop-katalyst 3.3.0 → 3.3.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: 04b7a088100580edc042b6f9197cfbb64c8b2aa3c8d978f0f4387f5774893d1c
4
- data.tar.gz: 9bf922ffa58eb94577825d45d1e517e250cba503b0149f4fdde6858928777491
3
+ metadata.gz: a6b16c5d6d98da6573092a04c8e314e51ebc59c3529b4a318dfb25908bf812c5
4
+ data.tar.gz: ef7528f898b148a08fffbc22afa54d9045f112b31d44c395dfce08ca5807c2ad
5
5
  SHA512:
6
- metadata.gz: bd0f4a6fc15f050e509908df4c3663945e290aac33dc861e371a376ae26705a20c0406ba31d663aee0e8aaeeaa85a6880e94246cfaa6109059fef8c0876667f7
7
- data.tar.gz: 896c9831d3abfe2459bf44982a50e5ae8b17f4f4b8183fbaf43ef0be790fd06e0dc479876c75a75ca4d475453f09b37a429bc9acd8d3c8474bb5f623a952dd4a
6
+ metadata.gz: f594757e43455794d5653bfa1f1e3ae87e19e089cbc60d577920c1965836f6b0f6bc25a42c8912fd645045dd08af6eb49c59a1c29d8ee323d2b55fe04f279e48
7
+ data.tar.gz: ed4ab5aee111a7236bf63402b6bbfc58ba7fbacb2579152530d40beb379e02eee6cb62e422ff0eaf087346cd4687cfdf545fc41d3f9199260717666233a56cb1
data/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ## [3.3.0] - 2026-08-18
2
2
 
3
- - Add Koi/TableAsset cop: admin index tables (index/archived views, row and
4
- table partials) should not render images or attachments. Flags
5
- `row.attachment` cells and `image_tag`/`image_pack_tag` helpers as a smell,
6
- without autocorrection.
3
+ - Add Koi/TableAsset cop: admin index tables (index/archived views and row
4
+ partials) should not render images or attachments. Flags `row.attachment`
5
+ cells and `image_tag`/`image_pack_tag` helpers as a smell, without
6
+ autocorrection.
7
7
 
8
8
  ## [3.2.0] - 2026-08-17
9
9
 
@@ -14,9 +14,7 @@ Koi/DuplicatesAssociation:
14
14
  - "**/app/models/**/*.rb"
15
15
 
16
16
  # Targets admin index views, which are only linted when RuboCop runs
17
- # through erb_lint, so it takes effect via `rake erb_lint`. `_table`
18
- # partials are included because they render index-style tables of child
19
- # records within a parent view.
17
+ # through erb_lint, so it takes effect via `rake erb_lint`.
20
18
  Koi/TableAsset:
21
19
  Description: "Index tables should not render images or attachments."
22
20
  Enabled: true
@@ -27,7 +25,6 @@ Koi/TableAsset:
27
25
  - "**/app/views/admin/**/index.html.erb"
28
26
  - "**/app/views/admin/**/archived.html.erb"
29
27
  - "**/app/views/admin/**/*.html+row.erb"
30
- - "**/app/views/admin/**/_table*.erb"
31
28
 
32
29
  # Targets admin views, which are only linted when RuboCop runs through
33
30
  # erb_lint, so it takes effect via `rake erb_lint`.
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "rake"
4
4
  require "rake/tasklib"
5
+ require "json"
5
6
 
6
7
  module RuboCop
7
8
  module Katalyst
@@ -40,8 +41,20 @@ module RuboCop
40
41
  File.join(root, ".prettierrc.json")
41
42
  end
42
43
 
44
+ # True when the nearest package.json (walking up from the working
45
+ # directory) already declares prettier. `yarn add` would rewrite that
46
+ # file and its lockfile, which leaves a dirty tree when a gem builds its
47
+ # dummy app in CI before running `rake release`.
48
+ def prettier_declared?
49
+ package_json = Pathname.new(root).ascend.map { |dir| dir.join("package.json") }.find(&:exist?)
50
+ return false unless package_json
51
+
52
+ json = JSON.parse(package_json.read)
53
+ %w[dependencies devDependencies].any? { |key| json[key].is_a?(Hash) && json[key].key?("prettier") }
54
+ end
55
+
43
56
  def install_prettier
44
- yarn("add", "--dev", "prettier")
57
+ yarn("add", "--dev", "prettier") unless prettier_declared?
45
58
  File.write(config, <<~JSON)
46
59
  {}
47
60
  JSON
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-katalyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 4.0.16
192
+ rubygems_version: 4.0.20
193
193
  specification_version: 4
194
194
  summary: Code standards for Katalyst
195
195
  test_files: []