Simplify the 'should not start with https?://' message wording
Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
parent
21da074346
commit
41c35986f8
@ -35,7 +35,7 @@ module RuboCop
|
|||||||
if value_node.source.start_with?(%r{^"https?://})
|
if value_node.source.start_with?(%r{^"https?://})
|
||||||
add_offense(
|
add_offense(
|
||||||
value_node.source_range,
|
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|
|
) do |corrector|
|
||||||
corrector.replace(value_node.source_range, value_node.source.gsub(%r{^"https?://}, "\""))
|
corrector.replace(value_node.source_range, value_node.source.gsub(%r{^"https?://}, "\""))
|
||||||
end
|
end
|
||||||
|
|||||||
@ -34,7 +34,7 @@ describe RuboCop::Cop::Cask::Url do
|
|||||||
|
|
||||||
let(:expected_offenses) 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,
|
severity: :convention,
|
||||||
line: 3,
|
line: 3,
|
||||||
column: 16,
|
column: 16,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user