-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linting commands to bin/packs (#43)
* Add some commands to bin/packs * Bump version * fix name of file * rubocop
- Loading branch information
Alex Evanczuk
authored
Oct 17, 2022
1 parent
3d9ede4
commit be7cc6f
Showing
6 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
lib/use_packwerk/private/interactive_cli/use_cases/lint_package_yml.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# typed: strict | ||
|
||
module UsePackwerk | ||
module Private | ||
module InteractiveCli | ||
module UseCases | ||
class LintPackageYml | ||
extend T::Sig | ||
extend T::Helpers | ||
include Interface | ||
|
||
sig { override.params(prompt: TTY::Prompt).void } | ||
def perform!(prompt) | ||
packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: 'Please select the packs you want to lint package.yml files for') | ||
packs.each do |p| | ||
new_package = ParsePackwerk::Package.new( | ||
name: p.name, | ||
enforce_privacy: p.enforce_privacy, | ||
enforce_dependencies: p.enforce_dependencies, | ||
dependencies: p.dependencies.uniq.sort, | ||
metadata: p.metadata | ||
) | ||
ParsePackwerk.write_package_yml!(new_package) | ||
end | ||
end | ||
|
||
sig { override.returns(String) } | ||
def user_facing_name | ||
'Lint packs/*/package.yml for one or more packs' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
26 changes: 26 additions & 0 deletions
26
lib/use_packwerk/private/interactive_cli/use_cases/regenerate_rubocop_todo.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# typed: strict | ||
|
||
module UsePackwerk | ||
module Private | ||
module InteractiveCli | ||
module UseCases | ||
class RegenerateRubocopTodo | ||
extend T::Sig | ||
extend T::Helpers | ||
include Interface | ||
|
||
sig { override.params(prompt: TTY::Prompt).void } | ||
def perform!(prompt) | ||
packs = PackSelector.single_or_all_pack_multi_select(prompt, question_text: 'Please select the packs you want to regenerate `.rubocop_todo.yml` for') | ||
RuboCop::Packs.auto_generate_rubocop_todo(packs: packs) | ||
end | ||
|
||
sig { override.returns(String) } | ||
def user_facing_name | ||
'Regenerate packs/*/.rubocop_todo.yml for one or more packs' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Gem::Specification.new do |spec| | ||
spec.name = 'use_packwerk' | ||
spec.version = '0.57.17' | ||
spec.version = '0.58.0' | ||
spec.authors = ['Gusto Engineers'] | ||
spec.email = ['[email protected]'] | ||
|
||
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec| | |
spec.add_dependency 'colorize' | ||
spec.add_dependency 'package_protections' | ||
spec.add_dependency 'parse_packwerk' | ||
spec.add_dependency 'rubocop-packs' | ||
spec.add_dependency 'sorbet-runtime' | ||
spec.add_dependency 'thor' | ||
spec.add_dependency 'tty-prompt' | ||
|