chore(readme_linter): Update plugin type guess logic (#15010)
This commit is contained in:
parent
c9fb4e74be
commit
94ee04aeb7
|
|
@ -1,7 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
type plugin int
|
type plugin int
|
||||||
|
|
@ -16,16 +16,19 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func guessPluginType(filename string) plugin {
|
func guessPluginType(filename string) plugin {
|
||||||
switch {
|
// Switch takes `plugins/inputs/amd_rocm_smi/README.md` and converts it to
|
||||||
case strings.Contains(filename, "plugins/inputs/"):
|
// `plugins/inputs`. This avoids parsing READMEs that are under a plugin
|
||||||
|
// like those found in test folders as actual plugin readmes.
|
||||||
|
switch filepath.Dir(filepath.Dir(filename)) {
|
||||||
|
case "plugins/inputs":
|
||||||
return pluginInput
|
return pluginInput
|
||||||
case strings.Contains(filename, "plugins/outputs/"):
|
case "plugins/outputs":
|
||||||
return pluginOutput
|
return pluginOutput
|
||||||
case strings.Contains(filename, "plugins/processors/"):
|
case "plugins/processors":
|
||||||
return pluginProcessor
|
return pluginProcessor
|
||||||
case strings.Contains(filename, "plugins/aggregators/"):
|
case "plugins/aggregators":
|
||||||
return pluginAggregator
|
return pluginAggregator
|
||||||
case strings.Contains(filename, "plugins/parsers/"):
|
case "plugins/parsers":
|
||||||
return pluginParser
|
return pluginParser
|
||||||
default:
|
default:
|
||||||
return pluginNone
|
return pluginNone
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue