mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
style: temporarily disable GitLab patch URL check
This commit is contained in:
parent
ef1e07b88b
commit
b5dec5fdbd
@ -56,11 +56,12 @@ module RuboCop
|
|||||||
problem "GitHub patches should end with .patch, not .diff: #{patch_url}"
|
problem "GitHub patches should end with .patch, not .diff: #{patch_url}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO: Uncomment once offenses have been fixed in Homebrew/homebrew-core and Homebrew/linuxbrew-core
|
||||||
# Only .diff passes `--full-index` to `git diff` and there is no documented way
|
# Only .diff passes `--full-index` to `git diff` and there is no documented way
|
||||||
# to get .patch to behave the same for GitLab.
|
# to get .patch to behave the same for GitLab.
|
||||||
if regex_match_group(patch_url_node, %r{.*gitlab.*/commit/[a-fA-F0-9]*\.patch})
|
# if regex_match_group(patch_url_node, %r{.*gitlab.*/commit/[a-fA-F0-9]*\.patch})
|
||||||
problem "GitLab patches should end with .diff, not .patch: #{patch_url}"
|
# problem "GitLab patches should end with .diff, not .patch: #{patch_url}"
|
||||||
end
|
# end
|
||||||
|
|
||||||
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
|
gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)}
|
||||||
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
|
if regex_match_group(patch_url_node, gh_patch_param_pattern) && !patch_url.match?(/\?full_index=\w+$/)
|
||||||
|
@ -181,7 +181,8 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
"https://github.com/uber/h3/pull/362.patch?full_index=1",
|
"https://github.com/uber/h3/pull/362.patch?full_index=1",
|
||||||
"https://gitlab.gnome.org/GNOME/gitg/-/merge_requests/142.diff",
|
"https://gitlab.gnome.org/GNOME/gitg/-/merge_requests/142.diff",
|
||||||
"https://github.com/michaeldv/pit/commit/f64978d.diff?full_index=1",
|
"https://github.com/michaeldv/pit/commit/f64978d.diff?full_index=1",
|
||||||
"https://gitlab.gnome.org/GNOME/msitools/commit/248450a.patch",
|
# TODO: Uncomment once the corresponding check is re-enabled
|
||||||
|
# "https://gitlab.gnome.org/GNOME/msitools/commit/248450a.patch",
|
||||||
]
|
]
|
||||||
patch_urls.each do |patch_url|
|
patch_urls.each do |patch_url|
|
||||||
source = <<~RUBY
|
source = <<~RUBY
|
||||||
@ -223,10 +224,11 @@ describe RuboCop::Cop::FormulaAudit::Patches do
|
|||||||
expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source
|
expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source
|
||||||
GitHub patches should end with .patch, not .diff: #{patch_url}
|
GitHub patches should end with .patch, not .diff: #{patch_url}
|
||||||
EOS
|
EOS
|
||||||
elsif patch_url.match?(%r{.*gitlab.*/commit/})
|
# TODO: Uncomment once the corresponding check is re-enabled
|
||||||
expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source
|
# elsif patch_url.match?(%r{.*gitlab.*/commit/})
|
||||||
GitLab patches should end with .diff, not .patch: #{patch_url}
|
# expect_offense_hash message: <<~EOS.chomp, severity: :convention, line: 5, column: 8, source: source
|
||||||
EOS
|
# GitLab patches should end with .diff, not .patch: #{patch_url}
|
||||||
|
# EOS
|
||||||
# rubocop:disable Layout/LineLength
|
# rubocop:disable Layout/LineLength
|
||||||
elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)})
|
elsif patch_url.match?(%r{https?://patch-diff\.githubusercontent\.com/raw/(.+)/(.+)/pull/(.+)\.(?:diff|patch)})
|
||||||
# rubocop:enable Layout/LineLength
|
# rubocop:enable Layout/LineLength
|
||||||
|
Loading…
x
Reference in New Issue
Block a user