diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-08-28 00:52:52 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-08-28 01:10:24 -0700 |
commit | f5da7c379bc287a1e19200358c917ddc5628351e (patch) | |
tree | 8a3b6a48a9e7c2326996b887e37790a21995485e /tool | |
parent | 94275d96a86a411d632d1746a8c017bc7939a972 (diff) |
Ignore test/regress/ for racc
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/sync_default_gems.rb | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb index 4320825c9d..457e927c03 100755 --- a/tool/sync_default_gems.rb +++ b/tool/sync_default_gems.rb @@ -424,26 +424,43 @@ module SyncDefaultGems replace_rdoc_ref_all end - IGNORE_FILE_PATTERN = - /\A(?:[A-Z]\w*\.(?:md|txt) - |[^\/]+\.yml - |\.git.* - |[A-Z]\w+file - |COPYING - |Gemfile.lock - |bin\/.* - |rakelib\/.* - |test\/lib\/.* - )\z/mx - - YARP_IGNORE_FILE_PATTERN = - /\A(?:Makefile\.in - |configure\.ac - |fuzz\/.* - |rust\/.* - |tasks\/.* - |ext\/yarp\/extconf\.rb - )\z/mx + def ignore_file_pattern_for(gem) + patterns = [] + + # Common patterns + patterns << %r[\A(?: + [A-Z]\w*\.(?:md|txt) + |[^/]+\.yml + |\.git.* + |[A-Z]\w+file + |COPYING + |Gemfile.lock + |bin/.* + |rakelib/.* + |test/lib/.* + )\z]mx + + # Gem-specific patterns + case gem + when "racc" + %r[\A(?: + test/regress/.* + )\z]mx + when "yarp" + %r[\A(?: + Makefile\.in + |configure\.ac + |fuzz/.* + |rust/.* + |tasks/.* + |ext/yarp/extconf\.rb + )\z]mx + end&.tap do |pattern| + patterns << pattern + end + + Regexp.union(*patterns) + end def message_filter(repo, sha, input: ARGF) log = input.read @@ -515,10 +532,7 @@ module SyncDefaultGems end # Ignore Merge commits and already-merged commits. - ignore_file_pattern = IGNORE_FILE_PATTERN - if gem == "yarp" - ignore_file_pattern = Regexp.union(ignore_file_pattern, YARP_IGNORE_FILE_PATTERN) - end + ignore_file_pattern = ignore_file_pattern_for(gem) commits.delete_if do |sha, subject| 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) |