mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
docs: improve plugins page (#4494)
This commit is contained in:
parent
2a1afc14cb
commit
eaf3ff0741
5 changed files with 45 additions and 7 deletions
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"sort"
|
||||
|
@ -17,6 +18,20 @@ import (
|
|||
|
||||
const listItemPrefix = "list-item-"
|
||||
|
||||
func getExampleSnippets() (*SettingSnippets, error) {
|
||||
reference, err := os.ReadFile(".golangci.reference.yml")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't read .golangci.reference.yml: %w", err)
|
||||
}
|
||||
|
||||
snippets, err := extractExampleSnippets(reference)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't extract example snippets from .golangci.reference.yml: %w", err)
|
||||
}
|
||||
|
||||
return snippets, nil
|
||||
}
|
||||
|
||||
func getLintersListMarkdown(enabled bool) string {
|
||||
linters, err := readJSONFile[[]*types.LinterWrapper](filepath.Join("assets", "linters-info.json"))
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue