Skip to content

Commit

Permalink
Ensure formatter doesn't change anything in pr (#8)
Browse files Browse the repository at this point in the history
* Ensure formatter doesn't change anything in pr

* Use [ instead of [[

* Fix quotes

* Add mage target

* Fix format error
  • Loading branch information
howardjohn authored and mergify[bot] committed Jul 9, 2019
1 parent 15280fc commit 166a48b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ steps:
- commands:
- go get github.com/magefile/mage
- mage -v
- mage -v gitdirty
plugins:
- docker#v3.2.0:
image: "golang:1.12"
12 changes: 12 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package main

import (
"fmt"
"io/ioutil"
"os"
"os/exec"
Expand Down Expand Up @@ -74,6 +75,17 @@ func Deps() error {
return nil
}

// Fails if the repo is dirty
func GitDirty() error {
o, err := sh.Output("git", "status", "--porcelain")
if o != "" || err != nil {
// Show the full status
sh.Run("git", "status")
return fmt.Errorf("git is dirty")
}
return nil
}

func parseGoModule() (string, error) {
modContents, err := ioutil.ReadFile("go.mod")
if err != nil {
Expand Down

0 comments on commit 166a48b

Please sign in to comment.