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.

Support for nontraditional casing in namespaces (SA1300)

See original GitHub issue

Applying StyleCop analyzers to an existing codebase is always difficult, but what happens when the company name begins with a small letter, e.g. eBay? How can you apply SA1300 to everything except the namespaces? Imagine tens of thousands of files with several hundred namespaces like:

eBay.Services.Shipping
eBay.Services.Shipping.Entities
eBay.Services.Auction
eBay.Services.Auction.Bidding

Although normally namespace names are PascalCase, Microsoft admits in their naming guidelines that

If your brand employs nontraditional casing, you should follow the casing defined by your brand, even if it deviates from normal namespace casing.

If someone were to do the work and create a PR, would it be acceptable to either:

a) include a “known terms dictionary” that SA1300 could use to ignore certain words? b) make a very specific exception for namespaces since company names do not always follow PascalCase?

Or, if neither of those would be accepted, is there any way to accomodate this situation?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
sharwellcommented, Feb 14, 2020

@jedidja this is now released to NuGet

0reactions
jedidjacommented, Feb 19, 2020

@mzhukovs @mlessmann @cytron201 Hope this works out for you 😃 Thanks @sharwell for merging this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

StyleCopAnalyzers/documentation/SA1300.md at master
The following types of elements should use an upper-case letter as the first letter of the element name: Namespaces; Classes; Enums; Enum members;...
Read more >
Namespace naming convention when [CompanyName ...
If your brand employs nontraditional casing, you should follow the casing defined by your brand, even if it deviates from normal namespace ...
Read more >
Disable Stylecop on single code line (the namespace)
There is a workaround. You can write like this: #region Generated Code namespace lowerCase.UpperCase.Etc { #endregion.
Read more >
Nontraditional Students: Supporting Changing ...
A variety of academic support services are necessary in order to ensure success for nontraditional students. These support services are macro and interpersonal ......
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