8000 stylecheck: allow error strings to begin with proper nouns by ChrisJr404 · Pull Request #1739 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

stylecheck: allow error strings to begin with proper nouns - #1739

Open
ChrisJr404 wants to merge 1 commit into
dominikh:masterfrom
ChrisJr404:st1005-proper-nouns
Open

ChrisJr404 wants to merge 1 commit into
dominikh:masterfrom
ChrisJr404:st1005-proper-nouns

Conversation

@ChrisJr404
Copy link
Copy Markdown

ST1005 reports error strings that start with a capital letter, unless the first word already looks like an initialism (it has an inner uppercase letter or a digit) or a function name. That leaves single capitalized words like "Docker" or "Travis" being flagged even though the capitalization is correct for a proper noun.

This adds a proper_nouns option that works the same way as initialisms: a configurable list, merged the same way, normalized on load, with a default set of common names (Docker, Kubernetes, Postgres, Terraform, and so on). If the first word matches an entry, the string is left alone. Matching is case sensitive and only applies to the first word.

I kept the default list small and conservative on purpose since it is easy to bikeshed, so happy to add or drop names if you have preferences.

Closes: gh-424

ST1005 flags any error string that starts with a capital letter unless
the first word looks like an initialism or a function name. That means
correctly written strings like "Docker failed to start" get reported,
because "Docker" is a single capitalized word.

Add a proper_nouns option, mirroring the existing initialisms list, so
the first word may be an allowed proper noun. It ships with a default
set of common names and can be extended per project.

Closes: dominikhgh-424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stylecheck: allow errors to begin with proper nouns

1 participant

0