PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.85k stars 373 forks source link

Download compatibility profiles lazily from a remote feed rather than shipping them #1148

Open rjmholt opened 5 years ago

rjmholt commented 5 years ago

Currently compatibility profiles for the UseCompatibleTypes and UseCompatibleCommands rules ship with PSSA and effectively double its size.

This represents large overhead for users who don't use these rules or who don't want all the profiles we ship by default.

Ideally the rules should have a way of identifying filesystem and remote assets, and when rules are run, download/install any remote assets not already on the machine. This will also require cataloguing remote assets in a systematic and dependable way.

Proposed implementation

One solution is to have rules as NuGet assets (taking care of both hosting and caching), and specifying profiles as URIs, so that file:// and https:// (for example) profiles can be easily distinguished.

This may create an unnecessary dependency on NuGet however.

Whatever the implementation it will need to:

ghost commented 4 years ago

A lot worse than "double its size," at least in some cases. In my installation as part of ms-vscode.powershell, compatibility_profiles takes up 278.1 MB out of 288.8 MB for all of PSScriptAnalyser!

rjmholt commented 4 years ago

Doubles the size of the compressed artefact. When installed, it's considerably larger

kilasuit commented 3 years ago

Can we not shell this out as a separate module that requires PSScriptAnalzyer for just the compatibility profiles?

ForNeVeR commented 1 year ago

JFYI, folks, we are having a problem with these files in intellij-powershell, and for now I'm going to just delete them from PSScriptAnalyzer bundled into our distribution. Everything else seems to work fine, and I am very hesitant to increase the unpacked plugin size tenfold in a new update :(

Some kind of on-demand downloading or consuming the compatibility rules in the packed form would be very nice.

I am ready to work/collaborate on this if you have an acceptable solution in mind. Or help on brainstorming if necessary.