Skip to content

Update PSUseCorrectCasing to enforce correct casing of language keywords #1546

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

Open
xtqqczze opened this issue Jul 19, 2020 · 3 comments
Open

Comments

@xtqqczze
Copy link

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

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?

@Jaykul
Copy link
Contributor

Jaykul commented Aug 15, 2021

dupe of #767?

@diabloNitz4
Copy link

Hello,

What new about this feature ? Is that enabled ? If yes how can we do this ?
I searched but nothing is working in my side.

Thanks

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

4 participants