Skip to content

Commit

Permalink
release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zabio3 committed Dec 7, 2019
1 parent 69e1f82 commit e71f29f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (

const name = "godolint"

const version = "0.1.0"
const version = "0.1.1"

const usage = `godolint - Dockerfile Linter written in Golang
Expand Down Expand Up @@ -72,7 +72,7 @@ func (cli *CLI) Run(args []string) int {
flags.BoolVar(&isVersion, "v", false, "version")

if err := flags.Parse(args[1:]); err != nil {
fmt.Fprintf(cli.ErrStream, "%v\n", err)
fmt.Fprint(cli.ErrStream, err)
return ExitCodeParseFlagsError
}

Expand All @@ -91,20 +91,20 @@ func (cli *CLI) Run(args []string) int {
file := args[length-1]
f, err := os.Open(file)
if err != nil {
fmt.Fprintf(cli.ErrStream, "%v\n", err)
fmt.Fprint(cli.ErrStream, err)
return ExitCodeFileError
}

r, err := parser.Parse(f)
if err != nil {
fmt.Fprintf(cli.ErrStream, "%v\n", err)
fmt.Fprint(cli.ErrStream, err)
return ExitCodeAstParseError
}

analyzer := linter.NewAnalyzer(ignoreRules)
rst, err := analyzer.Run(r.AST)
if err != nil {
fmt.Fprintf(cli.ErrStream, "%v\n", err)
fmt.Fprint(cli.ErrStream, err)
return ExitCodeLintCheckError
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ Other Commands:
--help -h Help about any command
--version -v Print the version information
`,
expectedErrStream: "flag: help requested\n",
expectedErrStream: "flag: help requested",
expectedExitCode: ExitCodeParseFlagsError,
},
{
command: "godolint --version",
expectedOutStream: "godolint version 0.1.0\n",
expectedOutStream: "godolint version 0.1.1\n",
expectedErrStream: "",
expectedExitCode: ExitCodeOK,
},
{
command: "godolint testdata/no-file",
expectedOutStream: "",
expectedErrStream: "open testdata/no-file: no such file or directory\n",
expectedErrStream: "open testdata/no-file: no such file or directory",
expectedExitCode: ExitCodeFileError,
},
{
Expand Down Expand Up @@ -94,7 +94,7 @@ Other Commands:
{
command: "godolint ../testdata/MaxScanSize_File",
expectedOutStream: "",
expectedErrStream: "dockerfile line greater than max allowed size of 65535\n",
expectedErrStream: "dockerfile line greater than max allowed size of 65535",
expectedExitCode: ExitCodeAstParseError,
},
{
Expand Down

0 comments on commit e71f29f

Please sign in to comment.