From d7fd07c200b5d003b38a0de182628438992d6cb4 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 3 Oct 2021 18:16:57 +0900 Subject: [PATCH] Add `Safety` section to documentation Follow up to https://github.com/rubocop/rubocop/pull/10094. --- docs/modules/ROOT/pages/cops_minitest.adoc | 4 +++- lib/rubocop/cop/minitest/assert_with_expected_argument.rb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/cops_minitest.adoc b/docs/modules/ROOT/pages/cops_minitest.adoc index 4fd66537..0ca6c4ac 100644 --- a/docs/modules/ROOT/pages/cops_minitest.adoc +++ b/docs/modules/ROOT/pages/cops_minitest.adoc @@ -458,7 +458,9 @@ assert(actual, 'message') This cop tries to detect when a user accidentally used `assert` when they meant to use `assert_equal`. -It is marked as unsafe because it is not possible to determine +=== Safety + +This cop is unsafe because it is not possible to determine whether the second argument of `assert` is a message or not. === Examples diff --git a/lib/rubocop/cop/minitest/assert_with_expected_argument.rb b/lib/rubocop/cop/minitest/assert_with_expected_argument.rb index ff45a2ae..55dbd1cc 100644 --- a/lib/rubocop/cop/minitest/assert_with_expected_argument.rb +++ b/lib/rubocop/cop/minitest/assert_with_expected_argument.rb @@ -6,8 +6,9 @@ module Minitest # This cop tries to detect when a user accidentally used # `assert` when they meant to use `assert_equal`. # - # It is marked as unsafe because it is not possible to determine - # whether the second argument of `assert` is a message or not. + # @safety + # This cop is unsafe because it is not possible to determine + # whether the second argument of `assert` is a message or not. # # @example # # bad