Skip to content
代码片段 群组 项目
未验证 提交 3e41f1d0 编辑于 作者: Peter Leitzen's avatar Peter Leitzen
浏览文件

Ignore Style/SignalException in Danger related code

Danger defines its own `fail` method which caused false positives and
forced inline disables.
上级 b8bc261b
No related branches found
No related tags found
无相关合并请求
...@@ -153,6 +153,12 @@ Style/FrozenStringLiteralComment: ...@@ -153,6 +153,12 @@ Style/FrozenStringLiteralComment:
Style/SpecialGlobalVars: Style/SpecialGlobalVars:
EnforcedStyle: use_builtin_english_names EnforcedStyle: use_builtin_english_names
Style/SignalException:
Exclude:
# Danger defines its own `fail` method
- '**/*/Dangerfile'
- 'tooling/danger/**/*.rb'
RSpec/FilePath: RSpec/FilePath:
Exclude: Exclude:
- 'qa/**/*' - 'qa/**/*'
......
...@@ -18,7 +18,7 @@ def check_database_dictionary_yaml(database_dictionary) ...@@ -18,7 +18,7 @@ def check_database_dictionary_yaml(database_dictionary)
markdown(PARTITIONING_COMMENT, file: database_dictionary.path, line: mr_line.succ) markdown(PARTITIONING_COMMENT, file: database_dictionary.path, line: mr_line.succ)
rescue Psych::Exception rescue Psych::Exception
# YAML could not be parsed, fail the build. # 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 rescue StandardError => e
warn "There was a problem trying to check the database dictionary file. Exception: #{e.class.name} - #{e.message}" warn "There was a problem trying to check the database dictionary file. Exception: #{e.class.name} - #{e.message}"
end end
......
...@@ -74,7 +74,7 @@ return if helper.mr_labels.include?(DATABASE_APPROVED_LABEL) ...@@ -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) migration_testing_has_run = helper.mr_labels.include?(DATABASE_TESTING_RUN_LABEL)
community_contribution = helper.mr_labels.include?(COMMUNITY_CONTRIBUTION_LABEL) community_contribution = helper.mr_labels.include?(COMMUNITY_CONTRIBUTION_LABEL)
if non_geo_migration_created && !migration_testing_has_run && !community_contribution 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 end
if helper.mr_labels.include?('database') || database.changes.any? if helper.mr_labels.include?('database') || database.changes.any?
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
unless experiments.class_files_removed? unless experiments.class_files_removed?
msg = "This merge request removes experiment: `#{experiments.removed_experiments.join(',')}`" \ msg = "This merge request removes experiment: `#{experiments.removed_experiments.join(',')}`" \
", please also remove the class file." ", please also remove the class file."
fail msg # rubocop:disable Style/SignalException fail msg
end end
# frozen_string_literal: true # 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)." 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" FEATURE_FLAG_LABEL = "feature flag"
......
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Style/SignalException
PATTERNS = %w[ PATTERNS = %w[
%a.btn.btn- %a.btn.btn-
......
# frozen_string_literal: true # 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)." 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 SUGGEST_MR_COMMENT = <<~SUGGEST_COMMENT.freeze
...@@ -57,5 +55,3 @@ end ...@@ -57,5 +55,3 @@ end
added_files.each do |saas_feature| added_files.each do |saas_feature|
check_yaml(saas_feature) check_yaml(saas_feature)
end end
# rubocop:enable Style/SignalException
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Style/SignalException
module Tooling module Tooling
module Danger module Danger
module AnalyticsInstrumentation module AnalyticsInstrumentation
......
...@@ -56,7 +56,6 @@ module StableBranch ...@@ -56,7 +56,6 @@ module StableBranch
Read the "QA e2e:package-and-test-ee" section for more details. Read the "QA e2e:package-and-test-ee" section for more details.
MSG MSG
# rubocop:disable Style/SignalException
def check! def check!
return unless valid_stable_branch? return unless valid_stable_branch?
...@@ -77,7 +76,6 @@ def check! ...@@ -77,7 +76,6 @@ def check!
warn WARN_PACKAGE_AND_TEST_MESSAGE warn WARN_PACKAGE_AND_TEST_MESSAGE
end end
end end
# rubocop:enable Style/SignalException
def encourage_package_and_qa_execution? def encourage_package_and_qa_execution?
valid_stable_branch? && valid_stable_branch? &&
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册