use_packs 0.0.17 → 0.0.18

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: 5086342ae2e0f40560917b22f01788921a3c64827d4019d1d7fa79d03fc9746e
4
- data.tar.gz: 219e6c64145ee4f65e8604f80043ce43290c61e80aabcfd934b2bccb34d4febd
3
+ metadata.gz: 4fb20cd9cb35a011b3acb88be1b604f9057d7328d9d0c15b096490afa5f69a3e
4
+ data.tar.gz: 1501aefe2f6e0f4050c5f514cbcdeae591252102b6b06c45c417ff8a7e0b616f
5
5
  SHA512:
6
- metadata.gz: 7d5d2757dff4b7e81f9331a2f9dec3dfdd0c76a3d361d632e00ea9aa5525c1b6ae584a89c4f92d06150317edae91282236d823600f5fbdfb86ee8d26dae5b872
7
- data.tar.gz: 2c62f8458b6442754b273c241a107494657c7ef807ffa73fc4a42e9e5a4c9aa4cbf68036cf5407eeb1cd4d3223a13f7782fb2999b76fcde7131402adb7f68679
6
+ metadata.gz: a70a73019026886d08e0eadc22bf96cc2e27ca3d2f6213dd0f7f5996335f11bd0986de2ddf6874f772c8edc55e437c3750e854768a45d495528738ead07e0cf7
7
+ data.tar.gz: 3c93acc23b81dc09d3cdc8ce225f5db095d4887f6f9b231a9bddf8dc32457aa302ac87fea155b25ba9c81c0855fa535e8ed5cabbb67ea270c6cea1c50c91c1f0
@@ -7,6 +7,8 @@ module UsePacks
7
7
 
8
8
  sig { override.params(file_move_operation: Private::FileMoveOperation).void }
9
9
  def before_move_file!(file_move_operation)
10
+ return unless rubocop_enabled?
11
+
10
12
  relative_path_to_origin = file_move_operation.origin_pathname
11
13
  relative_path_to_destination = file_move_operation.destination_pathname
12
14
 
@@ -50,6 +52,8 @@ module UsePacks
50
52
 
51
53
  sig { params(file_move_operations: T::Array[Private::FileMoveOperation]).void }
52
54
  def after_move_files!(file_move_operations)
55
+ return unless rubocop_enabled?
56
+
53
57
  # There could also be no TODOs for this file, but moving it produced TODOs. This could happen if:
54
58
  # 1) The origin pack did not enforce a rubocop, such as typed public APIs
55
59
  # 2) The file satisfied the cop in the origin pack, such as the Packs/RootNamespaceIsPackName, but the desired
@@ -63,5 +67,10 @@ module UsePacks
63
67
 
64
68
  RuboCop::Packs.regenerate_todo(files: files)
65
69
  end
70
+
71
+ sig { returns(T::Boolean) }
72
+ def rubocop_enabled?
73
+ Pathname.new('.rubocop.yml').exist?
74
+ end
66
75
  end
67
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: use_packs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership