Skip to content

Commit 8f8ded1

Browse files
authored
add use_pks (#159)
* add use_pks and use it in update * check and validate * bump version * remove white space
1 parent 913b4bb commit 8f8ded1

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GIT
1717
PATH
1818
remote: .
1919
specs:
20-
packs (0.0.43)
20+
packs (0.0.44)
2121
bigdecimal
2222
code_ownership (>= 1.33.0)
2323
packs-specification

lib/packs.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,29 @@ def self.start_interactive_mode!
3232

3333
sig { returns(T::Boolean) }
3434
def self.update
35-
Private.system_with('bin/packwerk update-todo')
35+
if Packs.config.use_pks
36+
Private.system_with('bin/pks update')
37+
else
38+
Private.system_with('bin/packwerk update-todo')
39+
end
3640
end
3741

3842
sig { returns(T::Boolean) }
3943
def self.validate
40-
Private.system_with('bin/packwerk validate')
44+
if Packs.config.use_pks
45+
Private.system_with('bin/pks validate')
46+
else
47+
Private.system_with('bin/packwerk validate')
48+
end
4149
end
4250

4351
sig { params(files: T::Array[String]).returns(T::Boolean) }
4452
def self.check(files)
45-
Private.system_with("bin/packwerk check #{files.join(' ')}")
53+
if Packs.config.use_pks
54+
Private.system_with("bin/pks check #{files.join(' ')}")
55+
else
56+
Private.system_with("bin/packwerk check #{files.join(' ')}")
57+
end
4658
end
4759

4860
sig do

lib/packs/configuration.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class Configuration
1313
sig { returns(UserEventLogger) }
1414
attr_accessor :user_event_logger
1515

16+
sig { returns(T::Boolean) }
17+
attr_accessor :use_pks
18+
1619
OnPackageTodoLintFailure = T.type_alias do
1720
T.proc.params(output: String).void
1821
end
@@ -25,6 +28,7 @@ def initialize
2528
@enforce_dependencies = T.let(default_enforce_dependencies, T::Boolean)
2629
@user_event_logger = T.let(DefaultUserEventLogger.new, UserEventLogger)
2730
@on_package_todo_lint_failure = T.let(->(output) {}, OnPackageTodoLintFailure)
31+
@use_pks = T.let(false, T::Boolean)
2832
end
2933

3034
sig { returns(T::Boolean) }

packs.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = 'packs'
3-
spec.version = '0.0.43'
3+
spec.version = '0.0.44'
44
spec.authors = ['Gusto Engineers']
55
spec.email = ['[email protected]']
66

0 commit comments

Comments
 (0)