-
Notifications
You must be signed in to change notification settings - Fork 389
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
PSUseSingularNouns Rule doesn't work in PowerShell Core but does in PowerShell #1626
Comments
This is known, because the Pluralisation API in .Net was not ported to .Net Core but the rule needs that API in order to work, hence why that rule is not available in PowerShell Core versions. This is documented here: https://github.com/PowerShell/PSScriptAnalyzer/tree/master/RuleDocumentation |
@bergmeister didn't see that. Thanks! |
Actually, I had a look and someone recently ported the old .NET API to .Net Core and published it. I opened PR #1627 that might be able to bring it back to PowerShell Core if the PowerShell Team is happy to accept using such an unofficial package. |
Given the fact that we don't think we can accept the unlicensed package that might resolve this issue in #1627, it might be worth briefly discussing other possibilities. In .NET Framework, the ability to run this rule came from Entity Framework, which was just reliably present on the machine thanks to .NET Fx's GAC. EF Core I believe has some kind of similar functionality, but doesn't expose it in such a general way (I believe deliberately to prevent people from relying on it like we used to). Even if they did, I think us shipping EF Core assemblies is probably something we don't want to do with PSSA. As much as I'd like to re-enable this particular rule, the complexity of doing so I think means that it's probably not something we're going to be able to do any time soon. |
@rjmholt Please check the PR again. I updated it to a different package, which is MIT licensed |
I'll mark it for discussion in our next issue triage |
Steps to reproduce
Run the following in both PowerShell and PowerShell core
Expected behavior
Both types of PowerShell should invoke the same rules.
Actual behavior
PowerShell Core doesn't invoke the same rules like PowerShell.
PSUseSingularNouns
is the only one that I have found thus far.Environment data
Note sure if the PowerShell Core is supported, but it should be as that is what we appear to be moving to. Also not sure if the issue is partly because of the two modules somehow being loaded. Tried to remove them but wasn't working.
The text was updated successfully, but these errors were encountered: