Last active
May 17, 2022 07:12
-
-
Save wtnabe/3fa990bc30874cf0907e712f2b31fe15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/awk -f | |
BEGIN { | |
filename = "" | |
} | |
/<markuplint> ([^:])+: (.)/ { # filename | |
sub(/\:$/, "", $2) | |
if ($3 == "✓") { | |
filename = "" | |
} else { | |
filename = remove_dir($2) | |
} | |
} | |
/^ +[0-9]+:[0-9]+/ { | |
if (filename) { | |
line = sprintf("%s:%s: ", filename, $1) | |
$1 = "" | |
line = line sprintf("%s ", $0) | |
print line | |
} | |
} | |
# | |
# @param {string} filename | |
# @return {string} | |
# | |
function remove_dir(filename) { | |
sub(ENVIRON["PWD"] "/", "", filename) | |
return filename | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
markuplint の出力が
みたいな感じで扱いにくい。上のスクリプトを
こんな感じで使うと
という形になってだいぶ扱いやすくなる。