Closed joel74 closed 8 years ago
It is about trailing 's', i.e. "Status" is treated as plural.
For example these "names" cause no issues:
function Get-PoolMemberStatu {}
function Get-PoolMemberCollectionStatu {}
Thanks, Nightroman. After a bit more testing, I believe it's more nuanced than that.
function get-Status{}
function get-MyStatus{}
function get-ThisHiss{}
I think it has to do specifically with the word 'Status' being combined with other words. Of the preceding 3 functions, only get-MyStatus{} threw a warning.
We rely on .NET's PluralizationService to tell us if a given "noun" is plural or not. Looks like it does not account for all kinds of words. One workaround is to maintain a dictionary of regex for most common exceptions..
Per a conversation we had today, we're proposing that we regex the noun to look for the last capitalized word to get the "base noun" which should be passed to PluralizationService. It's a bit of heuristic, but we couldn't come up with a new false positive that would be fired that isn't fired today.
Does anyone have any feedback?
That works for me. Thanks.
That's a good approach IMHO. The only potential that comes to mind as an exception here would be if you were ending your command with an acronym that finishes with "s". e.g. Restart-Iis. Exceptions like those should be pretty rare though, and if the command author can use a pragma to silence those types of exceptions at some point, we should be good.
Total 23816 words created by multiple letters combination with "S" as prefix, below there are some words listed starting with "S" Example: 1). Sacramentary 2). Satisfactive 3). Scholarships 4). Satisfactory 5). Sociologists etc.
I have two functions - Get-PoolMemberStatus' and 'Get-PoolMemberCollectionStatus' - that are failing the plural noun check. Maybe this check should consider case?