fix linters & switch to official linter (#4808)

This commit is contained in:
Marko
2020-05-07 16:17:43 +02:00
committed by GitHub
parent 9535c47067
commit 678010c45e
7 changed files with 14 additions and 13 deletions
+8 -7
View File
@@ -1,13 +1,14 @@
name: Lint
on: [pull_request]
jobs:
golangci-lint:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: golangci-lint
uses: reviewdog/action-golangci-lint@master
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@master
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
golangci_lint_flags: "--timeout 30m"
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.26
args: --timeout 10m
github-token: ${{ secrets.github_token }}
+1 -1
View File
@@ -38,7 +38,7 @@ linters:
# - whitespace
# - wsl
# - gocognit
# - nolintlint
- nolintlint
disable:
- errcheck
+1 -1
View File
@@ -168,5 +168,5 @@ func WriteConfigVals(dir string, vals map[string]string) error {
data += fmt.Sprintf("%s = \"%s\"\n", k, v)
}
cfile := filepath.Join(dir, "config.toml")
return ioutil.WriteFile(cfile, []byte(data), 0666)
return ioutil.WriteFile(cfile, []byte(data), 0600)
}
+1 -1
View File
@@ -19,7 +19,7 @@ func WriteConfigVals(dir string, vals map[string]string) error {
data += fmt.Sprintf("%s = \"%s\"\n", k, v)
}
cfile := filepath.Join(dir, "config.toml")
return ioutil.WriteFile(cfile, []byte(data), 0666)
return ioutil.WriteFile(cfile, []byte(data), 0600)
}
// RunWithArgs executes the given command with the specified command line args
+1 -1
View File
@@ -27,7 +27,7 @@ func TestWriteFileAtomic(t *testing.T) {
}
defer os.Remove(f.Name())
if err = ioutil.WriteFile(f.Name(), old, 0664); err != nil {
if err = ioutil.WriteFile(f.Name(), old, 0600); err != nil {
t.Fatal(err)
}
+1 -1
View File
@@ -84,7 +84,7 @@ func (q *chunkQueue) Add(chunk *chunk) (bool, error) {
}
path := filepath.Join(q.dir, strconv.FormatUint(uint64(chunk.Index), 10))
err := ioutil.WriteFile(path, chunk.Chunk, 0644)
err := ioutil.WriteFile(path, chunk.Chunk, 0600)
if err != nil {
return false, fmt.Errorf("failed to save chunk %v to file %v: %w", chunk.Index, path, err)
}
+1 -1
View File
@@ -136,7 +136,7 @@ func extractKey(tmhome, outputPath string) {
stateFile := filepath.Join(internal.ExpandPath(tmhome), "data", "priv_validator_state.json")
fpv := privval.LoadFilePV(keyFile, stateFile)
pkb := [64]byte(fpv.Key.PrivKey.(ed25519.PrivKeyEd25519))
if err := ioutil.WriteFile(internal.ExpandPath(outputPath), pkb[:32], 0644); err != nil {
if err := ioutil.WriteFile(internal.ExpandPath(outputPath), pkb[:32], 0600); err != nil {
logger.Info("Failed to write private key", "output", outputPath, "err", err)
os.Exit(1)
}