Skip to content

Commit

Permalink
Merge branch 'default-search-path'
Browse files Browse the repository at this point in the history
  • Loading branch information
5nord committed Dec 4, 2020
2 parents 165aaaf + 60f9c27 commit c0a8154
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions internal/cmds/lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package lint

import (
"fmt"
"io/ioutil"
"regexp"
"strings"
"sync"

"github.com/nokia/ntt/internal/loc"
"github.com/nokia/ntt/internal/log"
"github.com/nokia/ntt/internal/ntt"
"github.com/nokia/ntt/internal/ttcn3/ast"
"github.com/nokia/ntt/internal/ttcn3/doc"
Expand Down Expand Up @@ -149,25 +149,26 @@ func init() {
}

func lint(cmd *cobra.Command, args []string) error {
if config != "" {
b, err := ioutil.ReadFile(config)
if err != nil {
return err
}
suite, err := ntt.NewFromArgs(args...)
if err != nil {
return err
}

if err := yaml.UnmarshalStrict(b, &style); err != nil {
return err
}
c := suite.File(".ntt-lint.yml")
b, err := c.Bytes()
if err != nil {
log.Verbose(err.Error())
return nil
}

if err := buildRegexCache(); err != nil {
if err := yaml.UnmarshalStrict(b, &style); err != nil {
return err
}

suite, err := ntt.NewFromArgs(args...)
if err != nil {
if err := buildRegexCache(); err != nil {
return err
}

files, err := suite.Files()
if err != nil {
return err
Expand Down

0 comments on commit c0a8154

Please sign in to comment.