summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-06-17 11:51:17 +0200
committerJean Boussier <[email protected]>2025-06-17 15:28:05 +0200
commit4cb0205f51c1c49270027c41f539e8d120a13b6c ()
treeabb632452bafd4ec1d174bc10cb192879aa699ed
parent0933400f451813f08671dd02462f1a718e99d564 (diff)
Handle false positives in tool/auto-style.rb
Notes: Merged: https://.com/ruby/ruby/pull/13626
-rwxr-xr-xtool/auto-style.rb3
1 files changed, 2 insertions, 1 deletions
@@ -233,10 +233,11 @@ edited_files = files.select do |f|
if File.fnmatch?("*.[ch]", f, File::FNM_PATHNAME) &&
!DIFFERENT_STYLE_FILES.any? {|pat| File.fnmatch?(pat, f, File::FNM_PATHNAME)}
src.gsub!(/^\w+\([^(\n)]*?\)\K[ \t]*(?=\{$)/, "\n")
src.gsub!(/^([ \t]*)\}\K[ \t]*(?=else\b)/, "\n" '\1')
src.gsub!(/^[ \t]*\}\n\K\n+(?=[ \t]*else\b)/, '')
- indent = indent0 = true
end
if trailing0 or eofnewline0 or expandtab0 or indent0