前回は cljfmt を Native Image 化してみたんだけど
そしたら uochan さんが cljstyle のことを教えてくれたー!
cljfmt とデフォルトの挙動が違うので参考までですが、cljstyle という native image を release で配布しているプロジェクトもあったりします!https://t.co/QQ242xaJC6
— Iizuka Masashi (@uochan) January 6, 2022
GitHub Action もあるのでCIでも動かしやすいですhttps://t.co/7Aw8FPrPLQ
なんとー!
ということで!
みてみた
なるほどー!cljfmt の拡張みたいな感じ+ Native Image対応かー。便利そう!https://t.co/qk5wQOtSVd
— Mitsuyuki Shiiba (@bufferings) January 8, 2022
> Note that this is a rewrite of the original weavejester/cljfmt tool to provide more capabilities and configurability as well as a native-compiled binary.
からの
— Mitsuyuki Shiiba (@bufferings) January 8, 2022
からの
ふむふむふむーhttps://t.co/izpmEwPOv2
— Mitsuyuki Shiiba (@bufferings) January 8, 2022
よさそー!
ということで!
やってみよー!
インストールして
❯ brew install --cask cljstyle ... ==> Linking Binary 'cljstyle' to '/opt/homebrew/bin/cljstyle' 🍺 cljstyle was successfully installed!
試してみて
❯ time cljstyle check ... cljstyle check . 0.48s user 0.15s system 132% cpu 0.479 total
500msだー速いーヽ(=´▽`=)ノ
とりあえずインデントだけ 1 にする設定ファイルを書いてみて(デフォルトは 2 だから)
❯ cat ~/.cljstyle {:rules {:indentation {:list-indent 1} :namespaces {:indent-size 1}}}
IDEA に登録して(リンクの記事で紹介されてるみたいに FileWatcher でもいいけど、とりあえず前回使った External Tools で)
Keymap も適当に設定して
便利ー!ネームスペースもアルファベット順に並び替えられるみたい。好きな感じ。
あぁ、空行はデフォルトで2行なのかな。1でいいから、こうしとこ↓
{:rules {:blank-lines {:max-consecutive 1 :padding-lines 1} :indentation {:list-indent 1} :namespaces {:indent-size 1}}}
ちょこちょこ cljfmt と違う部分があるけど、こっちのが好きな感じだー!( uochan さんありがとうございますー!)