Start extracting language-specific formatters

This commit is contained in:
Michael Wolf
2023-09-18 16:44:26 -06:00
parent d1e6e953d1
commit 2cc53eb7e1
5 changed files with 72 additions and 4 deletions

View File

@@ -2,6 +2,24 @@ function root() {
echo "$(git rev-parse --show-toplevel)"
}
wfroot() {
dir="$1"
cat "$dir/.root"
}
function custom_formatter() {
root="$1"
file_type="$2"
maybe="$root/.would-reformat/$file_type"
if [[ -f "$maybe" ]] ; then
echo "$maybe"
return
fi
echo "use-default"
}
function sniff_file_type() {
ff=$1
shift
@@ -39,3 +57,8 @@ function sniff_file_type() {
echo $file_type
}
function wrflog() {
echo "$@" >> /tmp/wrflog
}