crystal-jp / introducing-crystal

『Introducing Crystal Programming Language』の原稿をまとめたリポジトリです

Home Page:https://crystal-jp.github.io/introducing-crystal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shardsでinstallしたライブラリも `crystal tool format` の対象にされてしまい落ちる

at-grandpa opened this issue · comments

CLI ビルダーの
https://github.com/mrrooijen/commander
をinstallしているのですが、crystal tool format をすると、

Error: '/path/to/techbookfest4/08-cli-development/projects/myecho_commander/lib/commander/spec/commander_spec.cr' has syntax errors

と落ちてしまいます。libディレクトリ配下は format の対象にしないほうが良さそうですね。

ちょっと対策考えます。パッチ思いつく方は大歓迎です!

make test の前に make lint が走る場合は大丈夫なのですが。。

https://github.com/mrrooijen/commander に PR送りますかね。。

このパッチでlib以下は入らなくなる気がする。

diff --git a/Makefile b/Makefile
index be2f594..f4e1d48 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ADOCS = \
   $(wildcard */*.adoc)
 EXAMPLES = $(wildcard */examples/**/*.cr)
 PROJECTS = $(wildcard */projects/*)
-PROJECT_CRS = $(and $(PROJECTS), $(shell find $(PROJECTS) -name '*.cr'))
+PROJECT_CRS = $(and $(PROJECTS), $(shell find $(PROJECTS) -type d -name lib -prune -o -name '*.cr' -print))
 ASSETS = $(shell find [0-9][0-9]-* -not -name '*.adoc')
 CRS = $(EXAMPLES) $(PROJECT_CRS)

お!行きました!

PR作っておきますねー

ボクがやります

お、ではお願いします