use_packwerk 0.50.1 → 0.51.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2b4528c3f2bf62833a4e6098e9f316e02ac3d26174738805c42da0461109415
|
4
|
+
data.tar.gz: 1d96176b9238a26ba97b82c5d231826f0a8485b8969bd9b74b13ed785cfbe917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2580a1e2bf19166f41e67ee0c6ad42052da9b49c3754251e9f898ba3839b41d29c68e97bc2a35ccd01b799078a6e6ebe2a00ec705e39b7e785c4b50169e35af
|
7
|
+
data.tar.gz: 923ebb508fcfc122d1a1e01c7a2a6e2849258bcfb99bc2d543bea3fecd43e7f64d9467c003034d167ba9f3c4e9f6b3091284915d7e0f98cbfbd8dd45d9dee940
|
@@ -9,6 +9,11 @@ module UsePackwerk
|
|
9
9
|
const :destination_pathname, Pathname
|
10
10
|
const :destination_pack, ParsePackwerk::Package
|
11
11
|
|
12
|
+
sig { returns(ParsePackwerk::Package) }
|
13
|
+
def origin_pack
|
14
|
+
T.must(ParsePackwerk.package_from_path(origin_pathname))
|
15
|
+
end
|
16
|
+
|
12
17
|
sig { params(origin_pathname: Pathname, new_package_root: Pathname).returns(Pathname) }
|
13
18
|
def self.destination_pathname_for_package_move(origin_pathname, new_package_root)
|
14
19
|
parts = origin_pathname.to_s.split('/')
|
@@ -11,12 +11,38 @@ module UsePackwerk
|
|
11
11
|
relative_path_to_destination = file_move_operation.destination_pathname
|
12
12
|
|
13
13
|
rubocop_todo = Pathname.new('.rubocop_todo.yml')
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
if rubocop_todo.exist?
|
15
|
+
UsePackwerk.replace_in_file(
|
16
|
+
file: rubocop_todo.to_s,
|
17
|
+
find: relative_path_to_origin,
|
18
|
+
replace_with: relative_path_to_destination,
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
if file_move_operation.origin_pack.name != ParsePackwerk::ROOT_PACKAGE_NAME && file_move_operation.destination_pack.name != ParsePackwerk::ROOT_PACKAGE_NAME
|
23
|
+
origin_rubocop_todo = file_move_operation.origin_pack.directory.join('.rubocop_todo.yml')
|
24
|
+
if origin_rubocop_todo.exist?
|
25
|
+
loaded_origin_rubocop_todo = YAML.load_file(origin_rubocop_todo)
|
26
|
+
new_origin_rubocop_todo = loaded_origin_rubocop_todo.dup
|
27
|
+
|
28
|
+
loaded_origin_rubocop_todo.each do |cop_name, cop_config|
|
29
|
+
if cop_config['Exclude'].include?(relative_path_to_origin.to_s)
|
30
|
+
new_origin_rubocop_todo[cop_name]['Exclude'] = cop_config['Exclude'] - [relative_path_to_origin.to_s]
|
31
|
+
origin_rubocop_todo.write(YAML.dump(new_origin_rubocop_todo))
|
32
|
+
|
33
|
+
destination_rubocop_todo = file_move_operation.destination_pack.directory.join('.rubocop_todo.yml')
|
34
|
+
if destination_rubocop_todo.exist?
|
35
|
+
new_destination_rubocop_todo = YAML.load_file(destination_rubocop_todo).dup
|
36
|
+
else
|
37
|
+
new_destination_rubocop_todo = { cop_name => { 'Exclude' => [] } }
|
38
|
+
end
|
39
|
+
|
40
|
+
new_destination_rubocop_todo[cop_name]['Exclude'] += [relative_path_to_destination.to_s]
|
41
|
+
destination_rubocop_todo.write(YAML.dump(new_destination_rubocop_todo))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
20
46
|
end
|
21
47
|
end
|
22
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_packwerk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.51.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusto Engineers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|