Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
36
tools/readme_linter/plugin.go
Normal file
36
tools/readme_linter/plugin.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type plugin int
|
||||
|
||||
const (
|
||||
pluginNone plugin = iota
|
||||
pluginInput
|
||||
pluginOutput
|
||||
pluginProcessor
|
||||
pluginAggregator
|
||||
pluginParser
|
||||
)
|
||||
|
||||
func guessPluginType(filename string) plugin {
|
||||
// Switch takes `plugins/inputs/amd_rocm_smi/README.md` and converts it to
|
||||
// `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
|
||||
case "plugins/outputs":
|
||||
return pluginOutput
|
||||
case "plugins/processors":
|
||||
return pluginProcessor
|
||||
case "plugins/aggregators":
|
||||
return pluginAggregator
|
||||
case "plugins/parsers":
|
||||
return pluginParser
|
||||
default:
|
||||
return pluginNone
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue