Simplify the 'should not start with https?://' message wording

Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
Issy Long 2023-04-02 22:43:52 +01:00
parent 21da074346
commit 41c35986f8
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ module RuboCop
if value_node.source.start_with?(%r{^"https?://})
add_offense(
value_node.source_range,
message: "Verified URL parameter value should not start with https:// or http://.",
message: "Verified URL parameter value should not contain a URL scheme.",
) do |corrector|
corrector.replace(value_node.source_range, value_node.source.gsub(%r{^"https?://}, "\""))
end

View File

@ -34,7 +34,7 @@ describe RuboCop::Cop::Cask::Url do
let(:expected_offenses) do
[{
message: "Verified URL parameter value should not start with https:// or http://.",
message: "Verified URL parameter value should not contain a URL scheme.",
severity: :convention,
line: 3,
column: 16,