-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Support list_of_files
and project
CLI lint modes for PSScriptAnalyzer linter
#1994
Comments
@Isalgeon good catch :) Please could you provide the working command line examples of your tests ? |
The command that I used during testing was I noticed you added an improvement a while back to apply fixes #93. Although it's technically outside the scope of this issue, I can see that the complete out-of-the-box command can be The above command doesn't account for all the various configuration settings though. ;-) |
Reiterating over my above suggestion, I realized that it's more in line with the
Luckily for us, it's possible to pipe an array of paths to the @("/tmp/lint/Test-Script.ps1", "/tmp/lint/modules/Some-Module.psm1") | Invoke-ScriptAnalyzer -EnableExit -Fix -Settings ".powershell-psscriptanalyzer.psd1"
|
my knownledge of Powershell scripting is close to zero.... maybe you'd like to make the pull request ? :) |
The same goes for my Python knowledge but I want to learn it anyway so now I have a concrete and worthy goal. :) |
Thanks :)
|
list_of_files
capability for PSScriptAnalyzer linterlist_of_files
and project
CLI lint modes for PSScriptAnalyzer linter
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
This issue is not stale. I haven't had much time to work on this yet, but I have secured a few hours at work to get a solution underway. |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
@nvuillam I've yet to confirm it to be 100% sure, but at first glance, it appears #2176 already tackled this issue in a 'different' linter. Oddly enough, both the PowerShell and PowerShell_formatter linters appear to use the same underlying linter (PSScriptAnalyzer). I'll make sure to confirm this tomorrow at the latest on the PR level and also make sure to test-drive the latest Docker image. I'm super excited about versions 6.17.0 and 6.18.0! 🤩 |
Basically, I don't think |
I don't think there's an out-of-the-box way of getting the I would already be fine with it being on a project basis since I lint everything anyway. ;-) |
@nvuillam, I've finally had the time to check this action off my list and yours. :-) I tested both PowerShell linters and the original still suits my project the best. I want to close this issue as I don't see the need for the However, I did notice that the performance of the linter does not quite match what I expected based on invoking the Could you clarify the difference and what I'm missing? Maybe @bdovaz has some insight here as well. If this is beyond the scope of this issue, I'm happy to fire a fresh one. ;-) |
@Isalgeon i'm still a newbie with dotnet stuff :/ |
Is your feature request related to a problem? Please describe.
I'm currently in the process of integrating/enabling the PowerShell linter (PSScriptAnalyzer) and I'm running into some serious performance hick-ups.
Describe the solution you'd like
Enable the
list_of_files
capability for the PSScriptAnalyzer linter by default.Describe alternatives you've considered
I've looked at the
Invoke-ScriptAnalyzer
command documentation and it appears to support both single file and directory-based linting.Providing a directory to the
-Path
argument along with the-Recurse
argument appears to work properly in-line with expectations.Additional context
In my repository with 117 PowerShell scripts and modules, the performance difference is off the charts:
file
CLI lint mode).list_of_files
CLI lint mode simulation).Configuring
list_of_files
CLI lint mode manually (i.e.POWERSHELL_POWERSHELL_CLI_LINT_MODE: "list_of_files"
) yields the following error:The text was updated successfully, but these errors were encountered: