Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually fix FactoryBot/FactoryAssociationWithStrategy RuboCop offenses #15837

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,18 @@ FactoryBot/ExcessiveCreateList:
Exclude:
- 'spec/controllers/webui/monitor_controller_spec.rb'

# Offense count: 33

# Offense count: 24
# Configuration parameters: Include.
# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb
FactoryBot/FactoryAssociationWithStrategy:
Exclude:
- 'spec/factories/attrib_default_values.rb'
- 'spec/factories/attribs.rb'
- 'spec/factories/azure_configuration.rb'
- 'spec/factories/bs_request_actions.rb'
- 'spec/factories/bs_requests.rb'
- 'spec/factories/comments.rb'
- 'spec/factories/download_repository_factory.rb'
- 'spec/factories/group_maintainers.rb'
- 'spec/factories/groups.rb'
- 'spec/factories/groups_user.rb'
- 'spec/factories/history_elements.rb'
- 'spec/factories/kiwi_package.rb'
- 'spec/factories/packages.rb'
- 'spec/factories/path_element.rb'
Expand All @@ -86,7 +82,6 @@ FactoryBot/FactoryAssociationWithStrategy:
- 'spec/factories/status_reports.rb'
- 'spec/factories/tokens.rb'
- 'spec/factories/watched_items.rb'
- 'spec/factories/workflow_artifacts_per_step.rb'
- 'spec/factories/workflow_runs.rb'

# Offense count: 3302
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/factories/attrib_default_values.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :attrib_default_value do
attrib_type { create(:attrib_type) }
attrib_type
position { 1 }
value { Faker::Lorem.word }
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/factories/azure_configuration.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :azure_configuration, class: 'Cloud::Azure::Configuration' do
user { create(:user) }
user
application_id { nil }
application_key { nil }

Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/factories/group_maintainers.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :group_maintainer do
user { create(:user) }
group { create(:group) }
user
group
end
end
4 changes: 2 additions & 2 deletions src/api/spec/factories/groups_user.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :groups_user do
user { create(:user) }
group { create(:group) }
user
group
end
end
2 changes: 1 addition & 1 deletion src/api/spec/factories/history_elements.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory 'history_element' do
user { create(:user) }
user
comment { Faker::Lorem.paragraph }

# Inheriting from HistoryElement::Review
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/factories/workflow_artifacts_per_step.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :workflow_artifacts_per_step, aliases: [:workflow_artifacts_per_step_branch_package] do
workflow_run { create(:workflow_run) }
workflow_run
step { 'Workflow::Step::BranchPackageStep' }

transient do
Expand Down