mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-05 23:57:04 +00:00
linter: add metalinter to Makefile & apply some fixes
This commit is contained in:
@@ -25,11 +25,13 @@ func New(coder Encoder, store keys.Storage, codec keys.Codec) Manager {
|
||||
}
|
||||
|
||||
// exists just to make sure we fulfill the Signer interface
|
||||
// nolint [ megacheck, deadcode ]
|
||||
func (s Manager) assertSigner() keys.Signer {
|
||||
return s
|
||||
}
|
||||
|
||||
// exists just to make sure we fulfill the Manager interface
|
||||
// nolint [ megacheck, deadcode ]
|
||||
func (s Manager) assertKeyManager() keys.Manager {
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ for key management, transaction signing, and query validation.
|
||||
Please read the README and godoc to see how to
|
||||
configure the server for your application.
|
||||
*/
|
||||
|
||||
// nolint: goimports
|
||||
package server
|
||||
|
||||
import (
|
||||
@@ -12,8 +14,8 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
data "github.com/tendermint/go-wire/data"
|
||||
"github.com/tendermint/go-crypto/keys/server/types"
|
||||
data "github.com/tendermint/go-wire/data"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -22,8 +22,8 @@ const (
|
||||
PrivExt = "tlc"
|
||||
PubExt = "pub"
|
||||
keyPerm = os.FileMode(0600)
|
||||
pubPerm = os.FileMode(0644)
|
||||
dirPerm = os.FileMode(0700)
|
||||
// pubPerm = os.FileMode(0644)
|
||||
dirPerm = os.FileMode(0700)
|
||||
)
|
||||
|
||||
type FileStore struct {
|
||||
@@ -43,6 +43,7 @@ func New(dir string) FileStore {
|
||||
}
|
||||
|
||||
// assertStorage just makes sure we implement the proper Storage interface
|
||||
// nolint [ megacheck, deadcode ]
|
||||
func (s FileStore) assertStorage() keys.Storage {
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ func New() MemStore {
|
||||
}
|
||||
|
||||
// assertStorage just makes sure we implement the Storage interface
|
||||
// nolint [ megacheck, deadcode ]
|
||||
func (s MemStore) assertStorage() keys.Storage {
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ func TestCheckInvalidLists(t *testing.T) {
|
||||
w, err := codec.BytesToWords(data)
|
||||
if tc.valid {
|
||||
assert.Nil(err, "%d: %+v", i, err)
|
||||
b, err := codec.WordsToBytes(w)
|
||||
assert.Nil(err, "%d: %+v", i, err)
|
||||
b, err1 := codec.WordsToBytes(w)
|
||||
assert.Nil(err1, "%d: %+v", i, err1)
|
||||
assert.Equal(data, b)
|
||||
} else {
|
||||
assert.NotNil(err, "%d", i)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
// keys/wordlist/spanish.txt
|
||||
// DO NOT EDIT!
|
||||
|
||||
// nolint: goimports
|
||||
package wordlist
|
||||
|
||||
import (
|
||||
@@ -204,9 +205,9 @@ func AssetNames() []string {
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"keys/wordlist/chinese_simplified.txt": keysWordlistChinese_simplifiedTxt,
|
||||
"keys/wordlist/english.txt": keysWordlistEnglishTxt,
|
||||
"keys/wordlist/japanese.txt": keysWordlistJapaneseTxt,
|
||||
"keys/wordlist/spanish.txt": keysWordlistSpanishTxt,
|
||||
"keys/wordlist/english.txt": keysWordlistEnglishTxt,
|
||||
"keys/wordlist/japanese.txt": keysWordlistJapaneseTxt,
|
||||
"keys/wordlist/spanish.txt": keysWordlistSpanishTxt,
|
||||
}
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
@@ -248,13 +249,14 @@ type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"keys": &bintree{nil, map[string]*bintree{
|
||||
"wordlist": &bintree{nil, map[string]*bintree{
|
||||
"chinese_simplified.txt": &bintree{keysWordlistChinese_simplifiedTxt, map[string]*bintree{}},
|
||||
"english.txt": &bintree{keysWordlistEnglishTxt, map[string]*bintree{}},
|
||||
"japanese.txt": &bintree{keysWordlistJapaneseTxt, map[string]*bintree{}},
|
||||
"spanish.txt": &bintree{keysWordlistSpanishTxt, map[string]*bintree{}},
|
||||
"english.txt": &bintree{keysWordlistEnglishTxt, map[string]*bintree{}},
|
||||
"japanese.txt": &bintree{keysWordlistJapaneseTxt, map[string]*bintree{}},
|
||||
"spanish.txt": &bintree{keysWordlistSpanishTxt, map[string]*bintree{}},
|
||||
}},
|
||||
}},
|
||||
}}
|
||||
@@ -305,4 +307,3 @@ func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user