未验证 提交 8730a2ee 编写于 作者: M Mislav Marohnić 提交者: GitHub

Merge pull request #1658 from github/fmt

Have CI fail if go code wasn't properly formatted
......@@ -111,7 +111,7 @@ func fork(cmd *Command, args *Args) {
if err == nil {
currentProject, err := currentRemote.Project()
if err == nil {
if currentProject.SameAs(forkProject){
if currentProject.SameAs(forkProject) {
ui.Printf("existing remote: %s\n", newRemoteName)
return
}
......
......@@ -25,4 +25,14 @@ script/build
script/build test || STATUS="$?"
script/ruby-test || STATUS="$?"
if [ -n "$CI" ]; then
make fmt >/dev/null
if ! git diff -U1 --exit-code; then
STATUS=1
echo
echo "Some go code was not formatted properly." >&2
echo "Run \`make fmt' locally to fix these errors." >&2
fi
fi
exit "$STATUS"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册