Fix pluginator incompatibility with nolint lines

This commit is contained in:
Katrina Verey
2022-11-28 19:11:09 -05:00
parent 832b552076
commit a612cd2b7e
27 changed files with 54 additions and 87 deletions

View File

@@ -72,10 +72,7 @@ func ConvertToBuiltInPlugin() (retErr error) {
if strings.HasPrefix(l, "//go:generate") {
continue
}
if strings.HasPrefix(l, "//noinspection") {
continue
}
if l == "var "+konfig.PluginSymbol+" plugin" {
if strings.HasPrefix(l, "var "+konfig.PluginSymbol+" plugin") {
continue
}
if strings.Contains(l, " Transform(") {
@@ -136,9 +133,12 @@ func newWriter(r string) (*writer, error) {
}
// Assume that this command is running with a $PWD of
// $HOME/kustomize/plugin/builtin/secretGenerator
//
// $HOME/kustomize/plugin/builtin/secretGenerator
//
// (for example). Then we want to write to
// $HOME/kustomize/api/builtins
//
// $HOME/kustomize/api/builtins
func makeOutputFileName(root string) string {
return filepath.Join(
"..", "..", "..", "api/internal", packageForGeneratedCode, root+".go")