Skip to content

Commit

Permalink
Regenerate TODOs and fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp-work committed Apr 19, 2023
1 parent 0dad9f3 commit 53df819
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
58 changes: 43 additions & 15 deletions src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
# on 2023-04-18 10:31:16 UTC using RuboCop version 1.50.2.
# on 2023-04-19 09:11:05 UTC using RuboCop version 1.50.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -662,7 +662,7 @@ RSpec/AnyInstance:
- 'spec/models/project_spec.rb'
- 'spec/policies/package_policy_spec.rb'

# Offense count: 1228
# Offense count: 1230
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand Down Expand Up @@ -737,6 +737,42 @@ RSpec/ExampleLength:
- 'spec/support/shared_examples/features/bootstrap_user_tab.rb'
- 'spec/support/shared_examples/features/flags_tables.rb'

# Offense count: 114
# Configuration parameters: Max.
RSpec/IndexedLet:
Exclude:
- 'spec/controllers/search_controller_spec.rb'
- 'spec/controllers/staging/excluded_requests_controller_spec.rb'
- 'spec/controllers/webui/attribute_controller_spec.rb'
- 'spec/controllers/webui/project_controller_spec.rb'
- 'spec/db/data/backfill_notified_projects_spec.rb'
- 'spec/db/data/generate_web_notifications_spec.rb'
- 'spec/db/data/project_log_entry_user_name_spec.rb'
- 'spec/db/data/remove_duplicated_flags_spec.rb'
- 'spec/db/data/remove_notifications_for_missing_notifiables_spec.rb'
- 'spec/features/webui/groups_spec.rb'
- 'spec/features/webui/image_templates_spec.rb'
- 'spec/features/webui/requests_spec.rb'
- 'spec/jobs/create_project_log_entry_job_spec.rb'
- 'spec/jobs/send_event_emails_job_spec.rb'
- 'spec/jobs/update_package_meta_job_spec.rb'
- 'spec/lib/statistics_calculations_spec.rb'
- 'spec/lib/tasks/rollout_spec.rb'
- 'spec/lib/tasks/workflows_spec.rb'
- 'spec/models/attrib_spec.rb'
- 'spec/models/package_spec.rb'
- 'spec/models/project/maintenance_incidents_spec.rb'
- 'spec/models/project/staging_project_spec.rb'
- 'spec/models/project/subprojects_spec.rb'
- 'spec/models/project/update_from_xml_command_spec.rb'
- 'spec/models/project_spec.rb'
- 'spec/models/review_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/models/workflow/step/configure_repositories_spec.rb'
- 'spec/support/shared_contexts/a_set_of_bs_requests.rb'
- 'spec/support/shared_contexts/a_user_and_subscriptions.rb'
- 'spec/support/shared_contexts/a_user_and_subscriptions_with_defaults.rb'

# Offense count: 43
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Expand All @@ -762,7 +798,7 @@ RSpec/IteratedExpectation:
RSpec/LeadingSubject:
Enabled: false

# Offense count: 72
# Offense count: 68
# This cop supports safe autocorrection (--autocorrect).
RSpec/MatchArray:
Exclude:
Expand Down Expand Up @@ -802,15 +838,6 @@ RSpec/MessageSpies:
RSpec/MultipleMemoizedHelpers:
Max: 28

# Offense count: 10
RSpec/PendingWithoutReason:
Exclude:
- 'spec/controllers/webui/download_on_demand_controller_spec.rb'
- 'spec/features/webui/attributes_spec.rb'
- 'spec/helpers/webui/user_helper_spec.rb'
- 'spec/helpers/webui/webui_helper_spec.rb'
- 'spec/models/relationship_spec.rb'

# Offense count: 12
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/Rails/HaveHttpStatus:
Expand Down Expand Up @@ -849,6 +876,7 @@ RSpec/RepeatedExampleGroupDescription:
- 'spec/policies/user_policy_spec.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
RSpec/ScatteredSetup:
Exclude:
- 'spec/controllers/webui/cloud/upload_jobs_controller_spec.rb'
Expand Down Expand Up @@ -1148,7 +1176,7 @@ Style/ExplicitBlockArgument:
- 'app/lib/backend/connection.rb'
- 'app/models/project.rb'

# Offense count: 1708
# Offense count: 1711
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Expand Down Expand Up @@ -1272,7 +1300,7 @@ Style/SoleNestedConditional:
- 'script/reformat_memprof'
- 'test/node_matcher.rb'

# Offense count: 370
# Offense count: 371
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Expand Down Expand Up @@ -1322,7 +1350,7 @@ ViewComponent/MissingPreviewFile:
- 'app/components/workflow_run_row_component.rb'
- 'app/components/write_and_preview_component.rb'

# Offense count: 2398
# Offense count: 2399
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/controllers/group_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

shared_examples 'successful group deletion' do
it 'responds with 200 OK' do
expect(response.code).to eq('200')
expect(response).to have_http_status(:ok)
end

it 'deletes the record' do
Expand Down
1 change: 1 addition & 0 deletions src/api/spec/helpers/webui/package_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
end
end
end

context 'is xml' do
it { expect(guess_code_class('_aggregate')).to eq('xml') }
it { expect(guess_code_class('_link')).to eq('xml') }
Expand Down
1 change: 1 addition & 0 deletions src/api/spec/models/badge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
end
end
end

context 'without type specified' do
let(:expected_success) { 'succeeded' }
let(:expected_failure) { 'failed' }
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/full_text_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
context 'existent issue and non-existent text' do
let(:search_params) { { issue_tracker_name: issue_tracker.name, issue_name: issue.name, text: 'Fake text' } }

it { expect(subject).to match_array([]) }
it { expect(subject).to be_empty }
end

context 'existent issue and existent text' do
Expand Down
6 changes: 3 additions & 3 deletions src/api/spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,10 @@

describe '#autocomplete_login' do
it { expect(User.autocomplete_login('foo')).to match_array(['foobar']) }
it { expect(User.autocomplete_login('bar')).to match_array([]) }
it { expect(User.autocomplete_login('bar')).to be_empty }
it { expect(User.autocomplete_login(nil)).to match_array(['foobar', 'fobaz']) }
it { expect(User.autocomplete_login(deleted_user.login)).to match_array([]) }
it { expect(User.autocomplete_login(locked_user.login)).to match_array([]) }
it { expect(User.autocomplete_login(deleted_user.login)).to be_empty }
it { expect(User.autocomplete_login(locked_user.login)).to be_empty }
end

describe '#autocomplete_token' do
Expand Down

0 comments on commit 53df819

Please sign in to comment.