diff --git a/.golangci.yml b/.golangci.yml index 67f93e74..eda5e5f4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,6 +24,9 @@ linters-settings: govet: # report about shadowed variables check-shadowing: false + staticcheck: + checks: ["all", "-SA1019"] # TODO Enable SA1019 after deprecated warning are fixed. + linters: enable: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c6f6048..46c9c896 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,3 +17,8 @@ repos: args: [--markdown-linebreak-ext=md] - id: end-of-file-fixer exclude: ".key$" + + - repo: https://github.com/golangci/golangci-lint + rev: v1.51.2 + hooks: + - id: golangci-lint diff --git a/object/object.go b/object/object.go index b564f5a7..b21cd697 100644 --- a/object/object.go +++ b/object/object.go @@ -117,7 +117,7 @@ func (o *Object) Signature() *frostfscrypto.Signature { } var sig frostfscrypto.Signature - sig.ReadFromV2(*sigv2) // FIXME(@cthulhu-rider): #226 handle error + _ = sig.ReadFromV2(*sigv2) // FIXME(@cthulhu-rider): #226 handle error return &sig } @@ -149,7 +149,7 @@ func (o *Object) SetPayload(v []byte) { func (o *Object) Version() *version.Version { var ver version.Version if verV2 := (*object.Object)(o).GetHeader().GetVersion(); verV2 != nil { - ver.ReadFromV2(*verV2) // FIXME(@cthulhu-rider): #226 handle error + _ = ver.ReadFromV2(*verV2) // FIXME(@cthulhu-rider): #226 handle error } return &ver } @@ -248,7 +248,7 @@ func (o *Object) PayloadChecksum() (checksum.Checksum, bool) { v2 := (*object.Object)(o) if hash := v2.GetHeader().GetPayloadHash(); hash != nil { - v.ReadFromV2(*hash) // FIXME(@cthulhu-rider): #226 handle error + _ = v.ReadFromV2(*hash) // FIXME(@cthulhu-rider): #226 handle error return v, true } @@ -278,7 +278,7 @@ func (o *Object) PayloadHomomorphicHash() (checksum.Checksum, bool) { v2 := (*object.Object)(o) if hash := v2.GetHeader().GetHomomorphicHash(); hash != nil { - v.ReadFromV2(*hash) // FIXME(@cthulhu-rider): #226 handle error + _ = v.ReadFromV2(*hash) // FIXME(@cthulhu-rider): #226 handle error return v, true } diff --git a/storagegroup/storagegroup.go b/storagegroup/storagegroup.go index 8722f511..5b358c39 100644 --- a/storagegroup/storagegroup.go +++ b/storagegroup/storagegroup.go @@ -114,7 +114,7 @@ func (sg *StorageGroup) SetValidationDataSize(epoch uint64) { func (sg StorageGroup) ValidationDataHash() (v checksum.Checksum, isSet bool) { v2 := (storagegroup.StorageGroup)(sg) if checksumV2 := v2.GetValidationHash(); checksumV2 != nil { - v.ReadFromV2(*checksumV2) // FIXME(@cthulhu-rider): #226 handle error + _ = v.ReadFromV2(*checksumV2) // FIXME(@cthulhu-rider): #226 handle error isSet = true }