dev: rewrite linters Manager ()

This commit is contained in:
Ludovic Fernandez 2024-03-02 21:43:28 +01:00 committed by GitHub
parent 26f8088b38
commit b14d05cdb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 1749 additions and 1825 deletions
scripts/expand_website_templates

View file

@ -204,8 +204,11 @@ func getDefaultExclusions() string {
}
func getLintersListMarkdown(enabled bool) string {
dbManager, _ := lintersdb.NewManager(nil, nil, lintersdb.NewLinterBuilder())
lcs := dbManager.GetAllSupportedLinterConfigs()
var neededLcs []*linter.Config
lcs := lintersdb.NewManager(nil, nil).GetAllSupportedLinterConfigs()
for _, lc := range lcs {
if lc.Internal {
continue
@ -322,8 +325,9 @@ type authorDetails struct {
func getThanksList() string {
addedAuthors := map[string]*authorDetails{}
dbManager, _ := lintersdb.NewManager(nil, nil, lintersdb.NewLinterBuilder())
for _, lc := range lintersdb.NewManager(nil, nil).GetAllSupportedLinterConfigs() {
for _, lc := range dbManager.GetAllSupportedLinterConfigs() {
if lc.Internal {
continue
}
@ -491,7 +495,8 @@ func extractExampleSnippets(example []byte) (*SettingSnippets, error) {
}
func getLintersSettingSections(node, nextNode *yaml.Node) (string, error) {
lcs := lintersdb.NewManager(nil, nil).GetAllSupportedLinterConfigs()
dbManager, _ := lintersdb.NewManager(nil, nil, lintersdb.NewLinterBuilder())
lcs := dbManager.GetAllSupportedLinterConfigs()
var lintersDesc = make(map[string]string)
for _, lc := range lcs {