Skip to content

False positive on PSUseSingularNoun noun for "Data"? #479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KirkMunro opened this issue Mar 28, 2016 · 2 comments
Closed

False positive on PSUseSingularNoun noun for "Data"? #479

KirkMunro opened this issue Mar 28, 2016 · 2 comments
Assignees
Milestone

Comments

@KirkMunro
Copy link
Contributor

I have a few functions that end with "Data", such as Add-ScriptMethodData, Add-AliasPropertyData, and Add-ScriptPropertyData. These three commands trip the PSUseSingularNoun warning. Technically Data is plural and Datum is singular, however in practice I doubt hardly anyone would ever use, or look for, Datum. PowerShell ships with Update-FormatData and Update-TypeData. With this in mind, can "Data" be added as an automatic exception to this rule so that commands ending with Data don't trigger it?

@kapilmb kapilmb self-assigned this Apr 23, 2016
@kapilmb kapilmb added this to the 1604 milestone Apr 23, 2016
@kapilmb kapilmb modified the milestones: 1605, 1604 May 3, 2016
@joeyaiello
Copy link
Contributor

The team agreed that this should be an exception to the rule, but we'd really like for there to be a standard way to define this sort of whitelist in a more general way than hard-coding the logic into each rule.

Of course, this gets back to the need for passing some kind of user data to rules (like for the PSAvoidUsingCmdletAliases rule). We've floated a few designs internally, but I still haven't gotten around to opening an issue for everyone to review (it got deprioritized in favor of auto-correction in VS Code).

If you think it's critical, Kirk, we could of course hardcode this one, but I'd like to move away from doing that as much as possible until we have a general design.

@KirkMunro
Copy link
Contributor Author

It's definitely not critical for me...I can ignore the rule for now (and it may go away for my module anyway because I'm considering replacing those commands with a dll for better performance anyway). I agree that hardcoding the exceptions to the rule one at a time isn't the right way to go, so figure out the right way to do it and fix it then.

@kapilmb kapilmb modified the milestones: 1605, 1606 Jun 1, 2016
@kapilmb kapilmb modified the milestones: 1606, backlog Jul 18, 2016
@kapilmb kapilmb modified the milestones: 1608, backlog Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants