Skip to content

Commit

Permalink
Bump rubocop-packs (#51)
Browse files Browse the repository at this point in the history
* Bump rubocop-packs

* Update tests

* Bump version
  • Loading branch information
Alex Evanczuk authored Nov 15, 2022
1 parent f34f3b2 commit 7807aac
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
use_packwerk (0.62.0)
use_packwerk (0.63.0)
code_ownership
colorize
packwerk (>= 2.2.1)
Expand Down Expand Up @@ -61,7 +61,7 @@ GEM
nokogiri (1.13.9)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
packwerk (2.2.1)
packwerk (2.2.2)
activesupport (>= 5.2)
ast
better_html
Expand All @@ -70,6 +70,7 @@ GEM
parallel
parser
sorbet-runtime (>= 0.5.9914)
zeitwerk (>= 2.6.1)
parallel (1.22.1)
parse_packwerk (0.14.0)
sorbet-runtime
Expand Down Expand Up @@ -123,7 +124,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
rubocop-packs (0.0.18)
rubocop-packs (0.0.20)
activesupport
parse_packwerk
rubocop
Expand Down Expand Up @@ -192,6 +193,7 @@ GEM
yard-sorbet (0.6.1)
sorbet-runtime (>= 0.5)
yard (>= 0.9)
zeitwerk (2.6.6)

PLATFORMS
ruby
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions spec/use_packwerk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def expect_files_to_not_exist(files)
end

it 'creates a package.yml correctly' do
RuboCop::Packs.configure do |config|
config.required_pack_level_cops = ['Department/SomeCop']
end

UsePackwerk.create_pack!(pack_name: 'packs/my_pack')
ParsePackwerk.bust_cache!
package = ParsePackwerk.find('packs/my_pack')
Expand All @@ -41,8 +45,9 @@ def expect_files_to_not_exist(files)
expect(package.enforce_dependencies).to eq(true)
expect(package.dependencies).to eq([])
expect(package.metadata).to eq({ 'owner' => 'MyTeam' })
expect(package.directory.join('.rubocop.yml').read).to eq(<<~YML)
inherit_from: "../../.base_rubocop.yml"
expect(package.directory.join(RuboCop::Packs::PACK_LEVEL_RUBOCOP_YML).read).to eq(<<~YML)
Department/SomeCop:
Enabled: true
YML

expected = <<~EXPECTED
Expand Down Expand Up @@ -129,6 +134,10 @@ def expect_files_to_not_exist(files)
let(:pack_name) { 'packs/fruits/apples' }

it 'creates a package.yml correctly' do
RuboCop::Packs.configure do |config|
config.required_pack_level_cops = ['Department/SomeCop']
end

UsePackwerk.create_pack!(pack_name: 'packs/fruits/apples')
ParsePackwerk.bust_cache!
package = ParsePackwerk.find('packs/fruits/apples')
Expand All @@ -137,8 +146,9 @@ def expect_files_to_not_exist(files)
expect(package.enforce_dependencies).to eq(true)
expect(package.dependencies).to eq([])
expect(package.metadata).to eq({ 'owner' => 'MyTeam' })
expect(package.directory.join('.rubocop.yml').read).to eq(<<~YML)
inherit_from: "../../.base_rubocop.yml"
expect(package.directory.join(RuboCop::Packs::PACK_LEVEL_RUBOCOP_YML).read).to eq(<<~YML)
Department/SomeCop:
Enabled: true
YML

expected = <<~EXPECTED
Expand Down
2 changes: 1 addition & 1 deletion use_packwerk.gemspec
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.62.0'
spec.version = '0.63.0'
spec.authors = ['Gusto Engineers']
spec.email = ['[email protected]']

Expand Down

0 comments on commit 7807aac

Please sign in to comment.