Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We have had problems with it: - it was slow - it is a non-standard extension of RuboCop's config - Include option exists - department-specific (e.g. FactoryBot) config was ignored
- Loading branch information
Showing
14 changed files
with
111 additions
and
107 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
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
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
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
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
4 changes: 4 additions & 0 deletions
4
spec/rubocop/cop/rspec/factory_bot/attribute_defined_statically_spec.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
4 changes: 4 additions & 0 deletions
4
spec/rubocop/cop/rspec/factory_bot/factory_class_name_spec.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.shared_context 'with RuboCop-RSpec config', :config do | ||
# This overrides the config defined in the default shared context since | ||
# RuboCop ignores department-level cop configuration in specs. | ||
let(:config) do | ||
department_name = cop_class.badge.department.to_s | ||
# By default, `RSpec/Include: ['**/*_spec.rb', '**/spec/**/*']` | ||
department_configuration = RuboCop::ConfigLoader | ||
.default_configuration | ||
.for_department(department_name) | ||
|
||
hash = { 'AllCops' => all_cops_config, | ||
cop_class.cop_name => cur_cop_config, | ||
department_name => department_configuration } | ||
.merge!(other_cops) | ||
|
||
RuboCop::Config.new(hash, "#{Dir.pwd}/.rubocop.yml") | ||
end | ||
end |
Oops, something went wrong.