Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
3dca5774
Commit
3dca5774
authored
Jun 04, 2019
by
Cristian Maglie
Committed by
Cristian Maglie
Jun 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated linter and fixed warnings
parent
c428dc37
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
+17
-15
.golangci.yml
.golangci.yml
+7
-0
.travis.yml
.travis.yml
+1
-3
common/formatter/formatter.go
common/formatter/formatter.go
+5
-9
configs/navigate_test.go
configs/navigate_test.go
+4
-3
No files found.
.golangci.yml
View file @
3dca5774
run
:
skip-dirs
:
-
legacy
linters-settings
:
govet
:
check-shadowing
:
true
...
...
@@ -21,6 +25,9 @@ linters-settings:
linters
:
enable-all
:
true
disable
:
-
goimports
-
gocritic
-
gochecknoglobals
-
gosec
-
deadcode
-
dupl
...
...
.travis.yml
View file @
3dca5774
...
...
@@ -10,9 +10,7 @@ env:
# build and immediately stop. It's sorta like having set -e enabled in bash.
# Make sure golangci-lint is vendored.
before_install
:
-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2
# Download the binary to bin folder in $GOPATH
-
curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.16.0
install
:
true
...
...
common/formatter/formatter.go
View file @
3dca5774
...
...
@@ -37,18 +37,14 @@ type Formatter interface {
// PrintFunc represents a function used to print formatted data.
type
PrintFunc
func
(
Formatter
,
interface
{})
error
var
formatters
map
[
string
]
Formatter
var
defaultFormatter
Formatter
var
formatters
=
map
[
string
]
Formatter
{
"text"
:
&
TextFormatter
{},
"json"
:
&
JSONFormatter
{},
}
var
defaultFormatter
=
formatters
[
"text"
]
var
logger
*
logrus
.
Logger
func
init
()
{
formatters
=
make
(
map
[
string
]
Formatter
,
2
)
AddCustomFormatter
(
"text"
,
&
TextFormatter
{})
AddCustomFormatter
(
"json"
,
&
JSONFormatter
{})
defaultFormatter
=
formatters
[
"text"
]
}
// SetFormatter sets the defaults format to the one specified, if valid. Otherwise it returns an error.
func
SetFormatter
(
formatName
string
)
error
{
if
!
IsSupported
(
formatName
)
{
...
...
configs/navigate_test.go
View file @
3dca5774
...
...
@@ -36,9 +36,10 @@ func TestNavigate(t *testing.T) {
"inheritance"
,
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
,
func
(
t
*
testing
.
T
)
{
pwd
:=
paths
.
New
(
"testdata"
,
"navigate"
,
tt
,
"first"
,
"second"
)
golden
:=
filepath
.
Join
(
"testdata"
,
"navigate"
,
tt
,
"golden.yaml"
)
_tt
:=
tt
t
.
Run
(
_tt
,
func
(
t
*
testing
.
T
)
{
pwd
:=
paths
.
New
(
"testdata"
,
"navigate"
,
_tt
,
"first"
,
"second"
)
golden
:=
filepath
.
Join
(
"testdata"
,
"navigate"
,
_tt
,
"golden.yaml"
)
config
,
_
:=
configs
.
NewConfiguration
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment