use_packs 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/use_packs/private.rb +11 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e985f265dd9fc9a580f8ebe329bb89a41b3445a67ca4b4416cb627c7adf3ce6e
4
- data.tar.gz: 31da3a703da54e26119c1075fb27b24aed4dd0b76c93af12c8b8de827b229d2e
3
+ metadata.gz: 5086342ae2e0f40560917b22f01788921a3c64827d4019d1d7fa79d03fc9746e
4
+ data.tar.gz: 219e6c64145ee4f65e8604f80043ce43290c61e80aabcfd934b2bccb34d4febd
5
5
  SHA512:
6
- metadata.gz: 4ead72b2296e414cbc512c476ff11e0df9ac53b7407920534742d9039e917998d2e329758666c3a201a339b1c6359189303b8b5b1661265441246c67425d6ea1
7
- data.tar.gz: e54e4771949e4d9ff229fd1c440e09a9ba042deebf1636a0e3bf1e8a2205078243dcb265d07f48357cb6e44babbd55dc1b6f8ce7013316eec7427f63ab8fb039
6
+ metadata.gz: 7d5d2757dff4b7e81f9331a2f9dec3dfdd0c76a3d361d632e00ea9aa5525c1b6ae584a89c4f92d06150317edae91282236d823600f5fbdfb86ee8d26dae5b872
7
+ data.tar.gz: 2c62f8458b6442754b273c241a107494657c7ef807ffa73fc4a42e9e5a4c9aa4cbf68036cf5407eeb1cd4d3223a13f7782fb2999b76fcde7131402adb7f68679
@@ -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
- Logging.print ColorizedString.new("[SKIP] Not moving #{origin}, does not exist").red
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
- exit 0
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
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.16
4
+ version: 0.0.17
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-17 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership