Start extracting language-specific formatters
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user