-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
plugin: allow to use settings for plugins #3887
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ldez
added
enhancement
New feature or improvement
linter: custom
About custom/private linters
labels
Jun 4, 2023
ldez
force-pushed
the
feat/clean-custom-plugin
branch
from
June 4, 2023 14:06
d828ce1
to
bc88c72
Compare
@pohly maybe this PR can interest you 😉 |
ldez
force-pushed
the
feat/clean-custom-plugin
branch
3 times, most recently
from
June 4, 2023 22:52
bb3aab6
to
bd36265
Compare
pohly
reviewed
Jun 5, 2023
ldez
force-pushed
the
feat/clean-custom-plugin
branch
2 times, most recently
from
June 6, 2023 21:59
9e5c2c9
to
2b966e1
Compare
ldez
force-pushed
the
feat/clean-custom-plugin
branch
2 times, most recently
from
June 6, 2023 22:44
7665163
to
a3496e3
Compare
bombsimon
approved these changes
Jun 9, 2023
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.
LGTM!
ldez
force-pushed
the
feat/clean-custom-plugin
branch
from
June 10, 2023 15:41
f6822d3
to
21f6cbd
Compare
pohly
added a commit
to pohly/logtools
that referenced
this pull request
Jun 12, 2023
This implements the new interface from golangci/golangci-lint#3887 with two fields in the "settings": type settings struct { Check map[string]bool `json:"check"` Config string `json:"config"` } This is the actual config *data*, not the name of a config file. This is intentional because - relative file paths wouldn't work (plugin cannot resolve them) - loading additional file content wouldn't invalidate cached linter results the that embedding the data inside the main config does The `include` text template method ensures that logcheck.conf gets injected automatically. Having it as separate file has the advantage that manual invocations of the stand-alone logcheck linter still work.
I've tested the current branch (= 21f6cbd) with kubernetes-sigs/logtools#18 successfully. |
alexandear
reviewed
Jun 13, 2023
Co-authored-by: Simon Sawert <[email protected]>
ldez
force-pushed
the
feat/clean-custom-plugin
branch
from
June 13, 2023 21:47
cc4906e
to
3bb0ccb
Compare
linxiulei
added a commit
to linxiulei/logtools
that referenced
this pull request
Jul 30, 2023
The new plugin interface was added in golangci/golangci-lint#3887 to allow settings for custom plugins. This commit implements the new plugin interface with find `config` value in the settings, and passes it to flag `--config`.
linxiulei
added a commit
to linxiulei/logtools
that referenced
this pull request
Jul 30, 2023
The new plugin interface was added in golangci/golangci-lint#3887 to allow settings for custom plugins. This commit implements the new plugin interface with find `config` value in the settings, and passes it to flag `--config`.
linxiulei
added a commit
to linxiulei/logtools
that referenced
this pull request
Jul 30, 2023
The new plugin interface was added in golangci/golangci-lint#3887 to allow settings for custom plugins. This commit implements the new plugin interface with `config` value in the settings, and passes it to flag `--config`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to introduce a new plugin contract that allow to pass settings to the plugin.
The previous contract based on
AnalyzerPlugin
interface still works: first we look for theNew
function and if don't find the right symbol we fallback to theAnalyzerPlugin
interface.Fixes #1512
To test the PR: