immosquare-cleaner 1.2.0 → 1.2.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: c24a5c00bdd269b3943555309f236e4a854d0b6bef7f21956dd3f16d4a28e6b2
4
- data.tar.gz: 692f7f8c8f1bed757e9b60e9d5f9e0a999258d730c77e3103f4d44a5e43ce253
3
+ metadata.gz: 8955a1cc723b8879a2b500cec45203853c478ba77f225dd271aeb2dd6fabf32e
4
+ data.tar.gz: 4cd13cd6271fc8eac845b4138fe64183c1325f2b0acd09a0243cb6be178f4fdf
5
5
  SHA512:
6
- metadata.gz: ef79d787125d74355d3302375d313a2503e5c2ba6c2db67d46889dc9e7cb5d40a2fb0c242d8e1fa8a3240182d6b18c39ff4c68ccc24a0904f14e5fc46fc816c4
7
- data.tar.gz: 73c13585ea4f87adb46b7a2712ac861e9c596b4f501e9027a7d8bd19be4f378fff498c17ff9c86e96fcd5332ada215cfa9b2fb1c01de81bce2a78b6c7b9fc382
6
+ metadata.gz: cd8d298e396a4956432fe9a7c38f653d4ef562f6516c2e8df3b124a9b0b74d106edf58f765c32a3260c8396d385b32b368c96979ea36b322c88837760ac4c964
7
+ data.tar.gz: 5cc16c3d0852e96e32d5d3e81046dcbeab39ef377dbcb0ebb4e1aa5c833edeb09a24aef1bac0c22f9b7e533bc15c79a2a467e921044f6bb6b6a5a9be57e8a2e6
@@ -27,7 +27,10 @@ module ImmosquareCleaner
27
27
  ## EXCLUDED_PATHS : paths relative to the root — generated or
28
28
  ## vendored content that repositories commit
29
29
  ## (db/schema.rb, Tauri schemas...) and test
30
- ## fixtures that must stay as written
30
+ ## fixtures that must stay as written: YAML
31
+ ## fixtures hold ERB tags Prettier would break,
32
+ ## sample files are compared byte for byte.
33
+ ## Test code itself is cleaned like any source.
31
34
  ##============================================================##
32
35
  EXCLUDED_DIRS = [
33
36
  ".git",
@@ -47,9 +50,10 @@ module ImmosquareCleaner
47
50
  "app/assets/images",
48
51
  "db",
49
52
  "public",
53
+ "spec/fixtures",
50
54
  "src-tauri/gen",
51
55
  "src-tauri/permissions/autogenerated",
52
- "test"
56
+ "test/fixtures"
53
57
  ].freeze
54
58
  EXCLUDED_FILES = [
55
59
  "npm-shrinkwrap.json",
@@ -29,6 +29,8 @@ module ImmosquareCleaner
29
29
  ].freeze
30
30
 
31
31
  def run
32
+ return if erb_templated_yaml?
33
+
32
34
  ##============================================================##
33
35
  ## Prettier flags:
34
36
  ## --no-color : strip ANSI escape codes — VS Code Output panel
@@ -40,6 +42,19 @@ module ImmosquareCleaner
40
42
  launch_cmds(cmds)
41
43
  end
42
44
 
45
+ private
46
+
47
+ ##============================================================##
48
+ ## A YAML file holding ERB tags (Rails' database.yml, cable.yml…)
49
+ ## is a template, not YAML. Prettier's YAML parser reads the Ruby
50
+ ## inside the tags as YAML syntax: `a ? :ci : :personal` becomes
51
+ ## `a ? :ci: :personal`, and a ternary in a value aborts with
52
+ ## "Nested mappings are not allowed". Such files are left as is.
53
+ ##============================================================##
54
+ def erb_templated_yaml?
55
+ file_path.end_with?(".yml", ".yaml") && File.read(file_path).include?("<%")
56
+ end
57
+
43
58
  end
44
59
  end
45
60
  end
@@ -1,3 +1,3 @@
1
1
  module ImmosquareCleaner
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.2.2".freeze
3
3
  end
data/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "@typescript-eslint/eslint-plugin": "^8.71.0",
13
13
  "@typescript-eslint/parser": "^8.71.0",
14
14
  "@typescript/native": "npm:typescript@^7.0.2",
15
- "eslint": "^10.11.0",
15
+ "eslint": "^10.12.0",
16
16
  "eslint-plugin-align-import": "^1.0.0",
17
17
  "eslint-plugin-erb": "^2.1.1",
18
18
  "eslint-plugin-prefer-arrow": "^1.2.3",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - immosquare