From 0b5fca42b758280fec9ce0a6c96c50219a42c516 Mon Sep 17 00:00:00 2001 From: Siddharth Asthana Date: Wed, 3 Aug 2022 20:55:00 +0530 Subject: [PATCH 1/2] RuboCop: Enable previously disabled Style/FormatString Changelog: other --- .rubocop_todo/style/format_string.yml | 43 ++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.rubocop_todo/style/format_string.yml b/.rubocop_todo/style/format_string.yml index caa293b31aeda8..66522603da2189 100644 --- a/.rubocop_todo/style/format_string.yml +++ b/.rubocop_todo/style/format_string.yml @@ -1,9 +1,6 @@ --- # Cop supports --auto-correct. Style/FormatString: - # Offense count: 769 - # Temporarily disabled due to too many offenses - Enabled: false Exclude: - 'app/components/diffs/overflow_warning_component.rb' - 'app/controllers/admin/application_settings_controller.rb' @@ -21,6 +18,7 @@ Style/FormatString: - 'app/controllers/concerns/membership_actions.rb' - 'app/controllers/concerns/redirects_for_missing_path_on_tree.rb' - 'app/controllers/concerns/spammable_actions/akismet_mark_as_spam_action.rb' + - 'app/controllers/concerns/verifies_with_email.rb' - 'app/controllers/groups/settings/ci_cd_controller.rb' - 'app/controllers/import/bitbucket_server_controller.rb' - 'app/controllers/import/bulk_imports_controller.rb' @@ -37,6 +35,8 @@ Style/FormatString: - 'app/controllers/profiles/preferences_controller.rb' - 'app/controllers/profiles/two_factor_auths_controller.rb' - 'app/controllers/profiles_controller.rb' + - 'app/controllers/projects/google_cloud/deployments_controller.rb' + - 'app/controllers/projects/google_cloud/service_accounts_controller.rb' - 'app/controllers/projects/issues_controller.rb' - 'app/controllers/projects/merge_requests_controller.rb' - 'app/controllers/projects/performance_monitoring/dashboards_controller.rb' @@ -56,15 +56,18 @@ Style/FormatString: - 'app/helpers/colors_helper.rb' - 'app/helpers/emails_helper.rb' - 'app/helpers/form_helper.rb' + - 'app/helpers/groups/group_members_helper.rb' - 'app/helpers/groups_helper.rb' - 'app/helpers/import_helper.rb' - 'app/helpers/invite_members_helper.rb' - 'app/helpers/issuables_helper.rb' - 'app/helpers/issues_helper.rb' + - 'app/helpers/members_helper.rb' - 'app/helpers/merge_requests_helper.rb' - 'app/helpers/mirror_helper.rb' - 'app/helpers/preferences_helper.rb' - 'app/helpers/profiles_helper.rb' + - 'app/helpers/projects/project_members_helper.rb' - 'app/helpers/projects_helper.rb' - 'app/helpers/registrations_helper.rb' - 'app/helpers/reminder_emails_helper.rb' @@ -83,6 +86,7 @@ Style/FormatString: - 'app/mailers/emails/profile.rb' - 'app/models/application_setting.rb' - 'app/models/application_setting_implementation.rb' + - 'app/models/concerns/integrations/has_issue_tracker_fields.rb' - 'app/models/concerns/limitable.rb' - 'app/models/concerns/metric_image_uploading.rb' - 'app/models/concerns/spammable.rb' @@ -108,6 +112,7 @@ Style/FormatString: - 'app/models/integrations/external_wiki.rb' - 'app/models/integrations/flowdock.rb' - 'app/models/integrations/hangouts_chat.rb' + - 'app/models/integrations/irker.rb' - 'app/models/integrations/jenkins.rb' - 'app/models/integrations/jira.rb' - 'app/models/integrations/mattermost.rb' @@ -119,6 +124,8 @@ Style/FormatString: - 'app/models/integrations/webex_teams.rb' - 'app/models/integrations/youtrack.rb' - 'app/models/integrations/zentao.rb' + - 'app/models/merge_request.rb' + - 'app/models/merge_request_diff.rb' - 'app/models/milestone.rb' - 'app/models/pages_domain.rb' - 'app/models/project.rb' @@ -129,6 +136,7 @@ Style/FormatString: - 'app/models/user.rb' - 'app/models/wiki.rb' - 'app/models/wiki_page.rb' + - 'app/models/work_items/parent_link.rb' - 'app/presenters/ci/pipeline_presenter.rb' - 'app/presenters/merge_request_presenter.rb' - 'app/presenters/project_presenter.rb' @@ -152,6 +160,7 @@ Style/FormatString: - 'app/services/gravatar_service.rb' - 'app/services/groups/transfer_service.rb' - 'app/services/import/bitbucket_server_service.rb' + - 'app/services/import/fogbugz_service.rb' - 'app/services/import/github_service.rb' - 'app/services/issuable_links/create_service.rb' - 'app/services/issues/clone_service.rb' @@ -169,7 +178,10 @@ Style/FormatString: - 'app/services/projects/create_from_template_service.rb' - 'app/services/projects/import_service.rb' - 'app/services/system_notes/design_management_service.rb' + - 'app/services/timelogs/create_service.rb' - 'app/services/users/banned_user_base_service.rb' + - 'app/services/work_items/parent_links/create_service.rb' + - 'app/services/work_items/widgets/hierarchy_service/base_service.rb' - 'app/validators/addressable_url_validator.rb' - 'app/validators/any_field_validator.rb' - 'app/validators/array_members_validator.rb' @@ -180,6 +192,13 @@ Style/FormatString: - 'config/initializers/rack_lineprof.rb' - 'danger/roulette/Dangerfile' - 'ee/app/components/billing/plan_component.rb' + - 'ee/app/components/namespaces/free_user_cap/alert_component.rb' + - 'ee/app/components/namespaces/free_user_cap/personable.rb' + - 'ee/app/components/namespaces/free_user_cap/personal_alert_component.rb' + - 'ee/app/components/namespaces/free_user_cap/personal_preview_alert_component.rb' + - 'ee/app/components/namespaces/free_user_cap/personal_usage_quota_limitations_alert_component.rb' + - 'ee/app/components/namespaces/free_user_cap/preview_alert_component.rb' + - 'ee/app/components/namespaces/free_user_cap/usage_quota_alert_component.rb' - 'ee/app/controllers/admin/elasticsearch_controller.rb' - 'ee/app/controllers/admin/geo/application_controller.rb' - 'ee/app/controllers/admin/geo/projects_controller.rb' @@ -190,6 +209,7 @@ Style/FormatString: - 'ee/app/controllers/ee/repositories/git_http_client_controller.rb' - 'ee/app/controllers/ee/repositories/lfs_api_controller.rb' - 'ee/app/controllers/groups/saml_group_links_controller.rb' + - 'ee/app/controllers/groups/settings/reporting_controller.rb' - 'ee/app/controllers/groups/sso_controller.rb' - 'ee/app/controllers/projects/requirements_management/requirements_controller.rb' - 'ee/app/controllers/subscriptions/groups_controller.rb' @@ -197,9 +217,11 @@ Style/FormatString: - 'ee/app/helpers/billing_plans_helper.rb' - 'ee/app/helpers/ee/application_helper.rb' - 'ee/app/helpers/ee/geo_helper.rb' + - 'ee/app/helpers/ee/groups/reporting_helper.rb' - 'ee/app/helpers/ee/groups/settings_helper.rb' - 'ee/app/helpers/ee/groups_helper.rb' - 'ee/app/helpers/ee/import_helper.rb' + - 'ee/app/helpers/ee/members_helper.rb' - 'ee/app/helpers/ee/profiles_helper.rb' - 'ee/app/helpers/ee/projects_helper.rb' - 'ee/app/helpers/ee/timeboxes_helper.rb' @@ -207,6 +229,7 @@ Style/FormatString: - 'ee/app/helpers/groups/sso_helper.rb' - 'ee/app/helpers/trial_registrations/reassurances_helper.rb' - 'ee/app/helpers/vulnerabilities_helper.rb' + - 'ee/app/mailers/ee/emails/admin_notification.rb' - 'ee/app/mailers/emails/namespace_storage_usage_mailer.rb' - 'ee/app/models/ci/minutes/notification.rb' - 'ee/app/models/dast/profile.rb' @@ -214,8 +237,10 @@ Style/FormatString: - 'ee/app/models/dast_site_profile.rb' - 'ee/app/models/dast_site_validation.rb' - 'ee/app/models/ee/member.rb' + - 'ee/app/models/ee/namespace/storage/notification.rb' - 'ee/app/models/geo/upload_registry.rb' - 'ee/app/models/integrations/github.rb' + - 'ee/app/models/iterations/cadence.rb' - 'ee/app/models/namespace_limit.rb' - 'ee/app/models/users_security_dashboard_project.rb' - 'ee/app/services/app_sec/dast/profiles/build_config_service.rb' @@ -227,6 +252,7 @@ Style/FormatString: - 'ee/app/services/concerns/incident_management/oncall_rotations/shared_rotation_logic.rb' - 'ee/app/services/dora/aggregate_metrics_service.rb' - 'ee/app/services/ee/projects/create_from_template_service.rb' + - 'ee/app/services/group_saml/saml_group_links/create_service.rb' - 'ee/app/services/incident_management/escalation_policies/base_service.rb' - 'ee/app/services/issues/build_from_vulnerability_service.rb' - 'ee/app/services/merge_requests/create_from_vulnerability_data_service.rb' @@ -236,15 +262,18 @@ Style/FormatString: - 'ee/app/services/vulnerabilities/destroy_dismissal_feedback_service.rb' - 'ee/app/services/vulnerabilities/dismiss_service.rb' - 'ee/app/services/vulnerabilities/finding_dismiss_service.rb' + - 'ee/app/services/vulnerabilities/findings/create_from_security_finding_service.rb' - 'ee/app/services/vulnerabilities/historical_statistics/adjustment_service.rb' - 'ee/app/services/vulnerabilities/statistics/adjustment_service.rb' - 'ee/app/services/vulnerability_external_issue_links/create_service.rb' + - 'ee/app/validators/user_existence_validator.rb' - 'ee/lib/audit/details.rb' - 'ee/lib/ee/audit/project_changes_auditor.rb' - 'ee/lib/ee/audit/project_setting_changes_auditor.rb' - 'ee/lib/ee/gitlab/checks/push_rules/branch_check.rb' - 'ee/lib/ee/gitlab/checks/push_rules/commit_check.rb' - 'ee/lib/ee/gitlab/ci/pipeline/chain/validate/security_orchestration_policy.rb' + - 'ee/lib/ee/gitlab/namespace_storage_size_error_message.rb' - 'ee/lib/ee/gitlab/quick_actions/epic_actions.rb' - 'ee/lib/ee/gitlab/quick_actions/issue_actions.rb' - 'ee/lib/ee/gitlab/quick_actions/issue_and_merge_request_actions.rb' @@ -256,11 +285,13 @@ Style/FormatString: - 'ee/lib/gitlab/auth/group_saml/response_check.rb' - 'ee/lib/gitlab/expiring_subscription_message.rb' - 'ee/lib/gitlab/geo.rb' + - 'ee/lib/gitlab/licenses/submit_license_usage_data_banner.rb' - 'ee/lib/gitlab/manual_quarterly_co_term_banner.rb' - 'ee/lib/gitlab/vulnerabilities/container_scanning_vulnerability.rb' - 'ee/lib/tasks/gitlab/elastic.rake' - 'ee/spec/controllers/admin/licenses_controller_spec.rb' - 'ee/spec/controllers/groups/security/policies_controller_spec.rb' + - 'ee/spec/features/admin/admin_settings_spec.rb' - 'ee/spec/features/admin/admin_users_spec.rb' - 'ee/spec/features/groups/analytics/cycle_analytics/filters_and_data_spec.rb' - 'ee/spec/features/groups/analytics/cycle_analytics/multiple_value_streams_spec.rb' @@ -273,6 +304,7 @@ Style/FormatString: - 'lib/gitlab/ci/ansi2json/line.rb' - 'lib/gitlab/ci/badge/coverage/template.rb' - 'lib/gitlab/ci/config/entry/tags.rb' + - 'lib/gitlab/ci/parsers/sbom/cyclonedx.rb' - 'lib/gitlab/ci/status/build/waiting_for_approval.rb' - 'lib/gitlab/config_checker/external_database_checker.rb' - 'lib/gitlab/config_checker/puma_rugged_checker.rb' @@ -293,6 +325,7 @@ Style/FormatString: - 'lib/gitlab/email/message/in_product_marketing/verify.rb' - 'lib/gitlab/exceptions_app.rb' - 'lib/gitlab/github_import/importer/pull_request_merged_by_importer.rb' + - 'lib/gitlab/github_import/importer/single_endpoint_issue_events_importer.rb' - 'lib/gitlab/github_import/issuable_finder.rb' - 'lib/gitlab/github_import/label_finder.rb' - 'lib/gitlab/github_import/milestone_finder.rb' @@ -307,6 +340,7 @@ Style/FormatString: - 'lib/gitlab/log_timestamp_formatter.rb' - 'lib/gitlab/metrics/dashboard/errors.rb' - 'lib/gitlab/metrics/dashboard/validator/errors.rb' + - 'lib/gitlab/pages/cache_control.rb' - 'lib/gitlab/quick_actions/command_definition.rb' - 'lib/gitlab/quick_actions/commit_actions.rb' - 'lib/gitlab/quick_actions/issuable_actions.rb' @@ -318,11 +352,11 @@ Style/FormatString: - 'lib/gitlab/version_info.rb' - 'lib/peek/views/detailed_view.rb' - 'lib/tasks/test.rake' - - 'qa/qa/service/docker_run/gitlab_runner.rb' - 'spec/controllers/graphql_controller_spec.rb' - 'spec/factories/lfs_objects.rb' - 'spec/features/admin/admin_users_spec.rb' - 'spec/features/groups/import_export/connect_instance_spec.rb' + - 'spec/features/issues/form_spec.rb' - 'spec/finders/serverless_domain_finder_spec.rb' - 'spec/graphql/resolvers/projects/jira_projects_resolver_spec.rb' - 'spec/helpers/profiles_helper_spec.rb' @@ -345,6 +379,7 @@ Style/FormatString: - 'spec/support/shared_examples/services/jira/requests/base_shared_examples.rb' - 'spec/support/shared_examples/views/registration_features_prompt_shared_examples.rb' - 'spec/validators/any_field_validator_spec.rb' + - 'spec/views/errors/omniauth_error.html.haml_spec.rb' - 'spec/views/groups/edit.html.haml_spec.rb' - 'spec/views/profiles/keys/_form.html.haml_spec.rb' - 'spec/views/profiles/notifications/show.html.haml_spec.rb' -- GitLab From a231c5e09e1f1e857b83fb8ba7f4ccebbbaf257e Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Wed, 10 Aug 2022 14:50:31 +0200 Subject: [PATCH 2/2] Disable RuboCop Style/FormatString in haml-lint --- .haml-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.haml-lint.yml b/.haml-lint.yml index 5e7b600097a329..1f4371bfe1cd8a 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -129,13 +129,14 @@ linters: - Rails/RequestReferer - Style/ColonMethodCall - Style/ConditionalAssignment + - Style/FormatString - Style/HashSyntax - Style/IdenticalConditionalBranches - Style/NegatedIf - Style/NestedTernaryOperator + - Style/RedundantInterpolation - Style/SelfAssignment - Style/StringConcatenation - - Style/RedundantInterpolation - Style/TernaryParentheses - Style/TrailingCommaInHashLiteral - Style/UnlessElse -- GitLab