-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat(cli): Add a command to list installed plugins #9140
base: main
Are you sure you want to change the base?
Conversation
0919aa9
to
e6d3d75
Compare
Add a command to list all installed plugins and their configuration options. The command is limited to plugins using the new plugin API, missing plugins will be added once they are migrated. Signed-off-by: Martin Nonnenmacher <[email protected]>
e6d3d75
to
2c21ea4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9140 +/- ##
=========================================
Coverage 67.16% 67.16%
Complexity 1187 1187
=========================================
Files 239 239
Lines 7899 7899
Branches 915 915
=========================================
Hits 5305 5305
Misses 2225 2225
Partials 369 369
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
For reference, output looks like this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have ort requirements --list=plugins
. Could you please detail in the commit message what's you plan regarding the relation of these commands? I guess once all plugins are migrated, ort requirements
should stop listed plugins at all, and the whole --list
option to that command could be removed?
@@ -0,0 +1,35 @@ | |||
/* | |||
* Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2024.
).split(",").default(PluginType.entries.map { it.optionName }) | ||
|
||
override fun run() { | ||
echo(HorizontalRule("Installed ORT Plugins", "=")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I'd omit this rule as it's clear from the command that ORT plugins are listed, and instead "promote" plugin type rules from "-" to "=", and introduce "-" rules for the individual plugins to better separate their options from the next plugin.
I wasn't even aware of the |
It's even documented 😉
I'm fine with having a separate command, as plugins are not really "requirements" after all (though you might expect a specific plugin to be present), and a dedicated sub-command could have more options to e.g. print out the plugin descriptor in JSON format. I probably just was too lazy to introduce a separate sub-command back then 😉 |
echo("Configuration options:") | ||
|
||
echo( | ||
UnorderedList( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using a table instead, with columns for the option name, type, and description?
Add a command to list all installed plugins and their configuration options.
The command is limited to plugins using the new plugin API, missing plugins will be added once they are migrated.