Closed
Description
Is your feature request related to a problem? Please describe.
According to this Go wiki, error strings should not be capitalized unless they begin with proper nouns or acronyms. Currently, the error-strings
rule cannot determine if the first word is an acronym or a proper noun. It only decreases the confidence from 0.8 to 0.6 if the first character is uppercase.
Describe the solution you'd like
Update the lintErrorString
function to correctly identify acronyms and proper nouns in most common cases.
Additional context
Examples of error strings that should be ignored by error-strings
:
errors.New("Rosetta is unsupported on non-ARM64 hosts")
https://github.com/lima-vm/lima/blob/9fd85199673d46188be880fb921442bc8f9134d2/pkg/vz/errors_darwin.go#L11fmt.Errorf("GitHub API request failed with status: %s", resp.Status)
https://github.com/rancher-sandbox/rancher-desktop/blob/415acbd0c93c063bedc60841e20d34abc699a308/scripts/k3s-versions.go#L101fmt.Errorf("OTP cannot be blank")
https://gitlab.com/gitlab-org/gitlab-shell/-/blob/5aa9a120163a2dc96ae46d55d79fe5c530e4cc52/internal/command/twofactorverify/twofactorverify.go#L85