use_packs 0.0.16 → 0.0.18
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 +4 -4
- data/lib/use_packs/private.rb +11 -4
- data/lib/use_packs/rubocop_post_processor.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb20cd9cb35a011b3acb88be1b604f9057d7328d9d0c15b096490afa5f69a3e
|
4
|
+
data.tar.gz: 1501aefe2f6e0f4050c5f514cbcdeae591252102b6b06c45c417ff8a7e0b616f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a70a73019026886d08e0eadc22bf96cc2e27ca3d2f6213dd0f7f5996335f11bd0986de2ddf6874f772c8edc55e437c3750e854768a45d495528738ead07e0cf7
|
7
|
+
data.tar.gz: 3c93acc23b81dc09d3cdc8ce225f5db095d4887f6f9b231a9bddf8dc32457aa302ac87fea155b25ba9c81c0855fa535e8ed5cabbb67ea270c6cea1c50c91c1f0
|
data/lib/use_packs/private.rb
CHANGED
@@ -324,7 +324,9 @@ module UsePacks
|
|
324
324
|
elsif !origin.exist? && destination.exist?
|
325
325
|
Logging.print ColorizedString.new("[SKIP] Not moving #{origin}, does not exist, (#{destination} already exists)").red
|
326
326
|
else
|
327
|
-
|
327
|
+
# We could choose to print this in a `--verbose` mode. For now, we find that printing this text in red confuses folks more than it informs them.
|
328
|
+
# This is because it's perfectly common for a spec to not exist for a file, so at best it's a warning.
|
329
|
+
# Logging.print ColorizedString.new("[SKIP] Not moving #{origin}, does not exist").red
|
328
330
|
end
|
329
331
|
end
|
330
332
|
|
@@ -529,7 +531,7 @@ module UsePacks
|
|
529
531
|
|
530
532
|
if diff == ''
|
531
533
|
# No diff generated by `update-todo`
|
532
|
-
|
534
|
+
safe_exit 0
|
533
535
|
else
|
534
536
|
output = <<~OUTPUT
|
535
537
|
All `package_todo.yml` files must be up-to-date and that no diff is generated when running `bin/packwerk update-todo`.
|
@@ -551,8 +553,7 @@ module UsePacks
|
|
551
553
|
|
552
554
|
puts output
|
553
555
|
UsePacks.config.on_package_todo_lint_failure.call(output)
|
554
|
-
|
555
|
-
exit 1
|
556
|
+
safe_exit 1
|
556
557
|
end
|
557
558
|
end
|
558
559
|
|
@@ -577,6 +578,12 @@ module UsePacks
|
|
577
578
|
5. Please let us know if anything is missing.
|
578
579
|
WARNING
|
579
580
|
end
|
581
|
+
|
582
|
+
# This function exists to give us something to stub in test
|
583
|
+
sig { params(code: Integer).void }
|
584
|
+
def self.safe_exit(code)
|
585
|
+
exit code
|
586
|
+
end
|
580
587
|
end
|
581
588
|
|
582
589
|
private_constant :Private
|
@@ -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.
|
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-
|
11
|
+
date: 2023-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: code_ownership
|