Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Oct 19, 2023
1 parent 97069e9 commit f2ff162
Show file tree
Hide file tree
Showing 230 changed files with 986 additions and 118 deletions.
15 changes: 0 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,13 @@ linters:
# Disable specific linter
# https://golangci-lint.run/usage/linters/#disabled-by-default
disable:
- contextcheck
- cyclop
- deadcode
- decorder
- depguard
- dupl
- dupword
- errchkjson
- errorlint
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- funlen
- gci
Expand All @@ -147,7 +141,6 @@ linters:
- gocognit
- goconst
- goerr113
- gofumpt
- goheader
- golint
- gomnd
Expand All @@ -158,19 +151,11 @@ linters:
- maintidx
- maligned
- musttag
- nilnil
- nlreturn
- nolintlint
- nosnakecase
- promlinter
- rowserrcheck
- scopelint
- sqlclosecheck
- structcheck
- thelper
- varcheck
- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl
1 change: 1 addition & 0 deletions api/v1/attesterduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@ func (a *AttesterDuty) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/beaconblockheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ func (b *BeaconBlockHeader) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
2 changes: 2 additions & 0 deletions api/v1/beaconcommittee.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (b *BeaconCommittee) MarshalJSON() ([]byte, error) {
for i := range b.Validators {
validators[i] = fmt.Sprintf("%d", b.Validators[i])
}

return json.Marshal(&beaconCommitteeJSON{
Slot: fmt.Sprintf("%d", b.Slot),
Index: fmt.Sprintf("%d", b.Index),
Expand Down Expand Up @@ -100,5 +101,6 @@ func (b *BeaconCommittee) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/beaconcommitteesubscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ func (b *BeaconCommitteeSubscription) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/blindedbeaconblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ func (b *BlindedBeaconBlock) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/blindedbeaconblock_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (b *BlindedBeaconBlock) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/bellatrix/blindedbeaconblock_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (b *BlindedBeaconBlock) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -51,5 +52,6 @@ func (b *BlindedBeaconBlock) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/blindedbeaconblockbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ func (b *BlindedBeaconBlockBody) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/blindedbeaconblockbody_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (b *BlindedBeaconBlockBody) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/bellatrix/blindedbeaconblockbody_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (b *BlindedBeaconBlockBody) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -64,5 +65,6 @@ func (b *BlindedBeaconBlockBody) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/signedblindedbeaconblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func (s *SignedBlindedBeaconBlock) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/bellatrix/signedblindedbeaconblock_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (s *SignedBlindedBeaconBlock) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return s.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/bellatrix/signedblindedbeaconblock_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (s *SignedBlindedBeaconBlock) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -45,5 +46,6 @@ func (s *SignedBlindedBeaconBlock) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return s.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/blobsidecarevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@ func (e *BlobSidecarEvent) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/blockevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ func (e *BlockEvent) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/capella/blindedbeaconblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ func (b *BlindedBeaconBlock) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/capella/blindedbeaconblock_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (b *BlindedBeaconBlock) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/capella/blindedbeaconblock_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (b *BlindedBeaconBlock) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -51,5 +52,6 @@ func (b *BlindedBeaconBlock) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/capella/blindedbeaconblockbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ func (b *BlindedBeaconBlockBody) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/capella/blindedbeaconblockbody_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (b *BlindedBeaconBlockBody) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/capella/blindedbeaconblockbody_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (b *BlindedBeaconBlockBody) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -66,5 +67,6 @@ func (b *BlindedBeaconBlockBody) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/capella/signedblindedbeaconblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func (s *SignedBlindedBeaconBlock) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/capella/signedblindedbeaconblock_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (s *SignedBlindedBeaconBlock) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return s.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/capella/signedblindedbeaconblock_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (s *SignedBlindedBeaconBlock) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -45,5 +46,6 @@ func (s *SignedBlindedBeaconBlock) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return s.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/chainreorgevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,6 @@ func (e *ChainReorgEvent) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedbeaconblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ func (b *BlindedBeaconBlock) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedbeaconblock_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (b *BlindedBeaconBlock) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/deneb/blindedbeaconblock_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (b *BlindedBeaconBlock) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -51,5 +52,6 @@ func (b *BlindedBeaconBlock) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedbeaconblockbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ func (b *BlindedBeaconBlockBody) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedbeaconblockbody_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (b *BlindedBeaconBlockBody) UnmarshalJSON(input []byte) error {
if err := json.Unmarshal(input, &data); err != nil {
return errors.Wrap(err, "invalid JSON")
}

return b.unpack(&data)
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1/deneb/blindedbeaconblockbody_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (b *BlindedBeaconBlockBody) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand All @@ -74,5 +75,6 @@ func (b *BlindedBeaconBlockBody) UnmarshalYAML(input []byte) error {
if err := yaml.Unmarshal(input, &data); err != nil {
return err
}

return b.unpack(&data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedblobsidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ func (b *BlindedBlobSidecar) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
1 change: 1 addition & 0 deletions api/v1/deneb/blindedblobsidecar_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (b *BlindedBlobSidecar) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

Expand Down
1 change: 1 addition & 0 deletions api/v1/deneb/blindedblockcontents.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ func (b *BlindedBlockContents) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
5 changes: 3 additions & 2 deletions api/v1/deneb/blindedblockcontents_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type blindedBlockContentsYAML struct {
BlindedBlobSidecars []*BlindedBlobSidecar `yaml:"blinded_blob_sidecars"`
}

// MarshalJSON implements json.Marshaler.
// MarshalYAML implements yaml.Marshaler.
func (b *BlindedBlockContents) MarshalYAML() ([]byte, error) {
yamlBytes, err := yaml.MarshalWithOptions(&blindedBlockContentsYAML{
BlindedBlock: b.BlindedBlock,
Expand All @@ -36,10 +36,11 @@ func (b *BlindedBlockContents) MarshalYAML() ([]byte, error) {
if err != nil {
return nil, err
}

return bytes.ReplaceAll(yamlBytes, []byte(`"`), []byte(`'`)), nil
}

// UnmarshalJSON implements json.Unmarshaler.
// UnmarshalYAML implements yaml.Unmarshaler.
func (b *BlindedBlockContents) UnmarshalYAML(input []byte) error {
var data blindedBlockContentsJSON
if err := yaml.Unmarshal(input, &data); err != nil {
Expand Down
1 change: 1 addition & 0 deletions api/v1/deneb/blockcontents.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func (b *BlockContents) String() string {
if err != nil {
return fmt.Sprintf("ERR: %v", err)
}

return string(data)
}
Loading

0 comments on commit f2ff162

Please sign in to comment.