question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Acronyms incorrectly detected as upper-case

See original GitHub issue

Faulty Behavior

fix: JTD types -> JSON schema types
✖   subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]

The above fails as the linter detects the subject as being upper-case, even though it’s just an acronym.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Check that all letters in the word are uppercase and assume it’s an acronym, ignoring any title-case lints. Skip for 1 letter words.

Steps to Reproduce (for bugs)

Lint the above commit message with @commitlint/config-conventional.

Your Environment

Executable Version
commitlint --version 17.0.3
git --version 2.34.1
node --version 16.15.1
@commitlint/config-conventional 17.0.3

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
escapedcatcommented, Aug 18, 2022

If you both agree now I’ll tag along. Up for a creating a PR?

1reaction
Qix-commented, Aug 17, 2022

“feat: CORRECT BODY MESSAGE”,

That would be a different check.

const isSubjectUpperCase = subject === subject.toUpperCase();

allow-list of acronyms

Please no. There are too many internal acronyms that would have to be maintained, and for three-letter acronyms almost all of them would be in the list anyway. Then, when you use one that just happens not to be on the list, you get cryptic errors about… what exactly? “Acronym not known”?

It’s not that complicated, in my opinion. This is a case where it’s beginning to get in the way of work and a simple, sane solution like the above would suffice in all but the most egregious cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spell Check Doesn't Work With Uppercase Words in Microsoft ...
Right-click any term with a red underline and click "Add to Dictionary." Word will never mark the term as if it were incorrectly...
Read more >
Capitalization of explanation of abbreviations
So: don't capitalize if the words are "common" and capitalize if the acronym refers to proper names. See also page 81 in this...
Read more >
Capital Letters in Acronyms and Abbreviations | Editor's Manual
Many abbreviations are capitalized (MBA, VP, DNA, ATM, URL), while others are lowercased (e.g., i.e., etc., laser). Some abbreviations may be ...
Read more >
Implement ESLint rule that detects camel-case acronym ...
In #668, we decided that acronyms in camel-case or pascal-case need to be fully capitalized (e.g. accountID , siteURL , someJSON ).
Read more >
Why do some newspapers not use uppercase letters ... - Quora
Many newspapers lowercase acronyms of five or more letters if they're pronounced as words. So, Ebitda rather than EBITDA. But ASPCA is often...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found