Sha256: 3522b1b58105a0e5ea6e337ea90c40cc9c728bfe0e88c43f362fb0f9485c357d
Contents?: true
Size: 354 Bytes
Versions: 49
Compression:
Stored size: 354 Bytes
Contents
#!/usr/bin/ruby # frozen_string_literal: true ARGV[0] || abort('Need arg') `clang-format -i #{ARGV[0]}` a = File.read ARGV[0] a = a.gsub(/(#include.+?\n)+/) do |i| i = i.split("\n").sort do |a, b| b.size <=> a.size end i = i.join "\n" i += "\n\n" end a.gsub!(%r{/\*.+?\*/}m, '') a.gsub!(%r{//.*?\n}m, "\n") a.strip! File.write ARGV[0], a
Version data entries
49 entries across 48 versions & 6 rubygems