diff --git a/.rubocop.yml b/.rubocop.yml index 544ef66fba6b2942dee105e48b4ee3af8a0864c4..7dfc2ae343d4353d9bbbfabd0c21ed9f288f96bc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -153,6 +153,12 @@ Style/FrozenStringLiteralComment: Style/SpecialGlobalVars: EnforcedStyle: use_builtin_english_names +Style/SignalException: + Exclude: + # Danger defines its own `fail` method + - '**/*/Dangerfile' + - 'tooling/danger/**/*.rb' + RSpec/FilePath: Exclude: - 'qa/**/*' diff --git a/danger/ci_tables/Dangerfile b/danger/ci_tables/Dangerfile index 1d4601d33b248b352e5f21348a41cb4ee860b235..422b77d337a1407e055d81ecb2e2dbc1ab75d053 100644 --- a/danger/ci_tables/Dangerfile +++ b/danger/ci_tables/Dangerfile @@ -18,7 +18,7 @@ def check_database_dictionary_yaml(database_dictionary) markdown(PARTITIONING_COMMENT, file: database_dictionary.path, line: mr_line.succ) rescue Psych::Exception # YAML could not be parsed, fail the build. - fail "#{helper.html_link(database_ditionary.path)} isn't valid YAML! #{SEE_DB_DOC}" # rubocop:disable Style/SignalException + fail "#{helper.html_link(database_ditionary.path)} isn't valid YAML! #{SEE_DB_DOC}" rescue StandardError => e warn "There was a problem trying to check the database dictionary file. Exception: #{e.class.name} - #{e.message}" end diff --git a/danger/database/Dangerfile b/danger/database/Dangerfile index f3bdddb0d9544d67aaf7e9f27d1ce1eebfc94fac..b7f2151dcf9bceae132e179fde1af4bdc04ad23f 100644 --- a/danger/database/Dangerfile +++ b/danger/database/Dangerfile @@ -74,7 +74,7 @@ return if helper.mr_labels.include?(DATABASE_APPROVED_LABEL) migration_testing_has_run = helper.mr_labels.include?(DATABASE_TESTING_RUN_LABEL) community_contribution = helper.mr_labels.include?(COMMUNITY_CONTRIBUTION_LABEL) if non_geo_migration_created && !migration_testing_has_run && !community_contribution - fail DB_MIGRATION_TESTING_REQUIRED_MESSAGE # rubocop:disable Style/SignalException + fail DB_MIGRATION_TESTING_REQUIRED_MESSAGE end if helper.mr_labels.include?('database') || database.changes.any? diff --git a/danger/experiments/Dangerfile b/danger/experiments/Dangerfile index 3a206bc876e3f21383dedd8844534003fe4e23b1..c23f94e8d947efc3402e9fdbba3b2c3bd49775a5 100644 --- a/danger/experiments/Dangerfile +++ b/danger/experiments/Dangerfile @@ -3,5 +3,5 @@ unless experiments.class_files_removed? msg = "This merge request removes experiment: `#{experiments.removed_experiments.join(',')}`" \ ", please also remove the class file." - fail msg # rubocop:disable Style/SignalException + fail msg end diff --git a/danger/feature_flag/Dangerfile b/danger/feature_flag/Dangerfile index 68e6cadd04e8990b1c2baf2d9af50d419af7ebd6..d44e83dbe537015030400bdf6a8f7a8e3a707a61 100644 --- a/danger/feature_flag/Dangerfile +++ b/danger/feature_flag/Dangerfile @@ -1,5 +1,4 @@ # frozen_string_literal: true -# rubocop:disable Style/SignalException SEE_DOC = "See the [feature flag documentation](https://docs.gitlab.com/ee/development/feature_flags#feature-flag-definition-and-validation)." FEATURE_FLAG_LABEL = "feature flag" diff --git a/danger/pajamas/Dangerfile b/danger/pajamas/Dangerfile index 5fe9e9e8b196a31c9153ae9f05de27ec9be427ac..cb13052c1e217f5ecbd0be512afb618193fd6406 100644 --- a/danger/pajamas/Dangerfile +++ b/danger/pajamas/Dangerfile @@ -1,5 +1,4 @@ # frozen_string_literal: true -# rubocop:disable Style/SignalException PATTERNS = %w[ %a.btn.btn- diff --git a/danger/saas_feature/Dangerfile b/danger/saas_feature/Dangerfile index 9fe684a517184014e20499f4134833977cc2b705..38ca87fb5fd07ec769f3cb11923f4ebdca904134 100644 --- a/danger/saas_feature/Dangerfile +++ b/danger/saas_feature/Dangerfile @@ -1,7 +1,5 @@ # frozen_string_literal: true -# rubocop:disable Style/SignalException - SEE_DOC = "see the [SaaS feature documentation](https://docs.gitlab.com/ee/development/ee_features.html#saas-only-feature)." SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT.freeze @@ -57,5 +55,3 @@ end added_files.each do |saas_feature| check_yaml(saas_feature) end - -# rubocop:enable Style/SignalException diff --git a/tooling/danger/analytics_instrumentation.rb b/tooling/danger/analytics_instrumentation.rb index cb0ca998c0418765085a0239a03e2b31cd025c9a..2f8066f4421c9c05f23cf46703227ef55bf9ca93 100644 --- a/tooling/danger/analytics_instrumentation.rb +++ b/tooling/danger/analytics_instrumentation.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -# rubocop:disable Style/SignalException - module Tooling module Danger module AnalyticsInstrumentation diff --git a/tooling/danger/stable_branch.rb b/tooling/danger/stable_branch.rb index 6335f82da3754ea509115a760c4d7992bb7c7928..8cb9e87964f2be92e53e09eb5f867cc190d2b43d 100644 --- a/tooling/danger/stable_branch.rb +++ b/tooling/danger/stable_branch.rb @@ -56,7 +56,6 @@ module StableBranch Read the "QA e2e:package-and-test-ee" section for more details. MSG - # rubocop:disable Style/SignalException def check! return unless valid_stable_branch? @@ -77,7 +76,6 @@ def check! warn WARN_PACKAGE_AND_TEST_MESSAGE end end - # rubocop:enable Style/SignalException def encourage_package_and_qa_execution? valid_stable_branch? &&