Add log capitalization analyzer and apply changes (#15452)

* Add log capitalization analyzer and apply fixes across codebase

Implements a new nogo analyzer to enforce proper log message capitalization and applies the fixes to all affected log statements throughout the beacon chain, validator, and supporting components.

Co-Authored-By: Claude <noreply@anthropic.com>

* Radek's feedback

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
terence
2025-07-10 06:43:38 -07:00
committed by GitHub
parent 5c1d827335
commit 16b567f6af
71 changed files with 616 additions and 159 deletions

View File

@@ -76,7 +76,7 @@ func (km *Keymanager) ImportKeystores(
}
}
if len(importedKeys) == 0 {
log.Warn("no keys were imported")
log.Warn("No keys were imported")
return statuses, nil
}
// 2) Update copied keystore with new keys,clear duplicates in existing set

View File

@@ -243,7 +243,7 @@ func TestLocalKeymanager_ImportKeystores(t *testing.T) {
fmt.Sprintf("incorrect password for key 0x%s", keystores[1].Pubkey),
statuses[1].Message,
)
require.LogsContain(t, hook, "no keys were imported")
require.LogsContain(t, hook, "No keys were imported")
})
t.Run("file write fails during import", func(t *testing.T) {
wallet.HasWriteFileError = true

View File

@@ -174,7 +174,7 @@ func (client *ApiClient) doRequest(ctx context.Context, httpMethod, fullPath str
"status": resp.StatusCode,
"request": string(requestDump),
"response": string(responseDump),
}).Error("web3signer request failed")
}).Error("Web3signer request failed")
}
if resp.StatusCode == http.StatusInternalServerError {
err = fmt.Errorf("internal Web3Signer server error, Signing Request URL: %v Status: %v", fullPath, resp.StatusCode)
@@ -217,6 +217,6 @@ func unmarshalSignatureResponse(responseBody io.ReadCloser) (bls.Signature, erro
// closeBody a utility method to wrap an error for closing
func closeBody(body io.Closer) {
if err := body.Close(); err != nil {
log.WithError(err).Error("could not close response body")
log.WithError(err).Error("Could not close response body")
}
}