Ignore test/regress/ for racc

This commit is contained in:
Takashi Kokubun 2023-08-28 00:52:52 -07:00
parent 94275d96a8
commit f5da7c379b

View File

@ -424,26 +424,43 @@ module SyncDefaultGems
replace_rdoc_ref_all replace_rdoc_ref_all
end end
IGNORE_FILE_PATTERN = def ignore_file_pattern_for(gem)
/\A(?:[A-Z]\w*\.(?:md|txt) patterns = []
|[^\/]+\.yml
# Common patterns
patterns << %r[\A(?:
[A-Z]\w*\.(?:md|txt)
|[^/]+\.yml
|\.git.* |\.git.*
|[A-Z]\w+file |[A-Z]\w+file
|COPYING |COPYING
|Gemfile.lock |Gemfile.lock
|bin\/.* |bin/.*
|rakelib\/.* |rakelib/.*
|test\/lib\/.* |test/lib/.*
)\z/mx )\z]mx
YARP_IGNORE_FILE_PATTERN = # Gem-specific patterns
/\A(?:Makefile\.in case gem
when "racc"
%r[\A(?:
test/regress/.*
)\z]mx
when "yarp"
%r[\A(?:
Makefile\.in
|configure\.ac |configure\.ac
|fuzz\/.* |fuzz/.*
|rust\/.* |rust/.*
|tasks\/.* |tasks/.*
|ext\/yarp\/extconf\.rb |ext/yarp/extconf\.rb
)\z/mx )\z]mx
end&.tap do |pattern|
patterns << pattern
end
Regexp.union(*patterns)
end
def message_filter(repo, sha, input: ARGF) def message_filter(repo, sha, input: ARGF)
log = input.read log = input.read
@ -515,10 +532,7 @@ module SyncDefaultGems
end end
# Ignore Merge commits and already-merged commits. # Ignore Merge commits and already-merged commits.
ignore_file_pattern = IGNORE_FILE_PATTERN ignore_file_pattern = ignore_file_pattern_for(gem)
if gem == "yarp"
ignore_file_pattern = Regexp.union(ignore_file_pattern, YARP_IGNORE_FILE_PATTERN)
end
commits.delete_if do |sha, subject| commits.delete_if do |sha, subject|
files = pipe_readlines(%W"git diff-tree -z --no-commit-id --name-only -r #{sha}") files = pipe_readlines(%W"git diff-tree -z --no-commit-id --name-only -r #{sha}")
subject.start_with?("Merge", "Auto Merge") or files.all?(ignore_file_pattern) subject.start_with?("Merge", "Auto Merge") or files.all?(ignore_file_pattern)