★ wanayoo — archive 1999 https://github.com/PowerShell/PSScriptAnalyzer/issues/1546Nouvelle recherche | Portail wanayoo
Skip to content
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

Update PSUseCorrectCasing to enforce correct casing of language keywords #1546

Open
xtqqczze opened this issue Jul 19, 2020 · 1 comment
Open

Comments

@xtqqczze
Copy link

@xtqqczze xtqqczze commented Jul 19, 2020

Summary of the new feature

Incorrect case of language keywords should result in a PSUseCorrectCasing rule violation.

A list of keywords can be obtained by reflection:

[ref].Assembly.GetType('System.Management.Automation.Language.Tokenizer').
GetDeclaredField('_keywordText').
ForEach{ $PSItem.GetValue($null) }
elseif
if
else
switch
foreach
from
in
for
while
until
do
try
catch
finally
trap
data
return
continue
break
exit
throw
begin
process
end
dynamicparam
function
filter
param
class
define
var
using
workflow
parallel
sequence
inlinescript
configuration
public
private
static
interface
enum
namespace
module
type
assembly
command
hidden
base

What is the latest version of PSScriptAnalyzer at the point of writing
1.19.0

@bergmeister
Copy link
Collaborator

@bergmeister bergmeister commented Jul 20, 2020

Similar to the other items #1475 and #1401 that you opened around enhancements for PSUseCorrectCasing, this is possible but not a priority right now. We'd be open to a PR though :)
@SydneyhSmith Any preference whether we should merge those 3 issues into one or keep them separate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.