[前][次][番号順一覧][スレッド一覧]

ruby-changes:57228

From: Takashi <ko1@a...>
Date: Fri, 23 Aug 2019 14:23:43 +0900 (JST)
Subject: [ruby-changes:57228] Takashi Kokubun: 1c5a268239 (master): Simplify expand_tabs.rb file selection

https://git.ruby-lang.org/ruby.git/commit/?id=1c5a268239

From 1c5a2682392ece013ae95215d97f0561591b6dc6 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Fri, 23 Aug 2019 13:57:19 +0900
Subject: Simplify expand_tabs.rb file selection


diff --git a/misc/expand_tabs.rb b/misc/expand_tabs.rb
index c3c55ab..c4f6fda 100755
--- a/misc/expand_tabs.rb
+++ b/misc/expand_tabs.rb
@@ -139,10 +139,8 @@ git = Git.new('HEAD^', 'HEAD') https://github.com/ruby/ruby/blob/trunk/misc/expand_tabs.rb#L139
 
 Dir.chdir(git.toplevel) do
   paths = git.updated_paths
-  paths.select! {|l|
-    /^\d/ !~ l and /\.bat\z/ !~ l and
-    (/\A(?:config|[Mm]akefile|GNUmakefile|README)/ =~ File.basename(l) or
-     /\A\z|\.(?:[chsy]|\d+|e?rb|tmpl|bas[eh]|z?sh|in|ma?k|def|src|trans|rdoc|ja|en|el|sed|awk|p[ly]|scm|mspec|html|)\z/ =~ File.extname(l))
+  paths.select! {|f|
+    (f.end_with?('.c') || f.end_with?('.h') || f == 'insns.def') && EXPANDTAB_IGNORED_FILES.all? { |re| !f.match(re) }
   }
   files = paths.select {|n| File.file?(n)}
   exit if files.empty?
@@ -152,7 +150,7 @@ Dir.chdir(git.toplevel) do https://github.com/ruby/ruby/blob/trunk/misc/expand_tabs.rb#L150
 
     expanded = false
     updated_lines = git.updated_lines(f)
-    if !updated_lines.empty? && (f.end_with?('.c') || f.end_with?('.h') || f == 'insns.def') && EXPANDTAB_IGNORED_FILES.all? { |re| !f.match(re) }
+    unless updated_lines.empty?
       src.gsub!(/^.*$/).with_index do |line, lineno|
         if updated_lines.include?(lineno) && line.start_with?("\t") # last-committed line with hard tabs
           expanded = true
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]