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

Add supported_platforms for plugins #1220

Open
brynary opened this issue Nov 26, 2024 · 3 comments
Open

Add supported_platforms for plugins #1220

brynary opened this issue Nov 26, 2024 · 3 comments

Comments

@brynary
Copy link
Member

brynary commented Nov 26, 2024

Certain plugins may not be compatible with all platforms that we run on. For example, we have identified issues with Hadolint on MacOS, and we have identified issues with swiftlint on non-MacOS systems.

Add a supported_platforms array key to the plugin definition:

[plugins.definitions.swiftlint]
supported_platforms = ["macos"]
# ...

Valid array values are "macos", "linux", and "windows".

If supported_platforms is empty, treat it as all platforms. If supported_platforms is not blank:

  1. qlty init should only enable the plugin if it is on a supported platform.
  2. The planner should skip the plugin when running on a supported platform (if the platform is unsupported on the current platform, log an info!)
@brynary brynary changed the title Plugin platform targets Add supported_platforms for plugins Nov 26, 2024
@lsegal lsegal added the feature label Nov 26, 2024
@brynary brynary removed the feature label Dec 6, 2024
@noahd1
Copy link
Member

noahd1 commented Dec 18, 2024

@brynary

It occurred to me that supported_platforms is probably more an attribute of a version of a plugin than the plugin itself, but perhaps we do not make that distinction today. E.g. what happens / how do we handle if e.g. 1.0 of a plugin's output differs from 2.0?

@brynary
Copy link
Member Author

brynary commented Dec 18, 2024

The way we handle that is with multiple driver definitions. Driver definitions can target version ranges of plugins

So if we defined the supported platforms data at the driver level instead of the plugin level then you could model this

(One plugin has one or more drivers)

@noahd1
Copy link
Member

noahd1 commented Dec 18, 2024

@brynary you wrote:

The planner should skip the plugin when running on a supported platform (if the platform is unsupported on the current platform, log an info!)

I'm assuming you meant to write that the planner should skip the plugin when running on an unsupported platform?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants