Skip to content

Commit 143a517

Browse files
committed
review: shared -> types
1 parent 9e757fe commit 143a517

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

scripts/website/dump_info/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111

1212
"github.com/golangci/golangci-lint/pkg/config"
1313
"github.com/golangci/golangci-lint/pkg/lint/lintersdb"
14-
"github.com/golangci/golangci-lint/scripts/website/shared"
14+
"github.com/golangci/golangci-lint/scripts/website/types"
1515
)
1616

1717
func main() {
1818
linters := lintersdb.NewLinterBuilder().Build(config.NewDefault())
1919

20-
var wraps []shared.LinterWrapper
20+
var wraps []types.LinterWrapper
2121
for _, l := range linters {
22-
wraps = append(wraps, shared.LinterWrapper{Config: l, Name: l.Linter.Name(), Desc: l.Linter.Desc()})
22+
wraps = append(wraps, types.LinterWrapper{Config: l, Name: l.Linter.Name(), Desc: l.Linter.Desc()})
2323
}
2424

2525
err := saveToJSONFile(filepath.Join("assets", "linters-info.json"), wraps)
@@ -62,7 +62,7 @@ func saveCLIHelp(dst string) error {
6262
helpLines := bytes.Split(help, []byte("\n"))
6363
shortHelp := bytes.Join(helpLines[2:], []byte("\n"))
6464

65-
data := shared.CLIHelp{
65+
data := types.CLIHelp{
6666
Enable: string(lintersOutParts[0]),
6767
Disable: string(lintersOutParts[1]),
6868
Help: string(shortHelp),

scripts/website/expand_templates/linters.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ import (
1212
"gopkg.in/yaml.v3"
1313

1414
"github.com/golangci/golangci-lint/pkg/config"
15-
"github.com/golangci/golangci-lint/scripts/website/shared"
15+
"github.com/golangci/golangci-lint/scripts/website/types"
1616
)
1717

1818
const listItemPrefix = "list-item-"
1919

2020
func getLintersListMarkdown(enabled bool) string {
21-
linters, err := readJSONFile[[]*shared.LinterWrapper](filepath.Join("assets", "linters-info.json"))
21+
linters, err := readJSONFile[[]*types.LinterWrapper](filepath.Join("assets", "linters-info.json"))
2222
if err != nil {
2323
panic(err)
2424
}
2525

26-
var neededLcs []*shared.LinterWrapper
26+
var neededLcs []*types.LinterWrapper
2727
for _, lc := range linters {
2828
if lc.Internal {
2929
continue
@@ -57,7 +57,7 @@ func getLintersListMarkdown(enabled bool) string {
5757
return strings.Join(lines, "\n")
5858
}
5959

60-
func getName(lc *shared.LinterWrapper) string {
60+
func getName(lc *types.LinterWrapper) string {
6161
name := lc.Name
6262

6363
if lc.OriginalURL != "" {
@@ -87,7 +87,7 @@ func check(b bool, title string) string {
8787
return ""
8888
}
8989

90-
func getDesc(lc *shared.LinterWrapper) string {
90+
func getDesc(lc *types.LinterWrapper) string {
9191
desc := lc.Desc
9292
if lc.IsDeprecated() {
9393
desc = lc.Deprecation.Message
@@ -236,7 +236,7 @@ func extractExampleSnippets(example []byte) (*SettingSnippets, error) {
236236
}
237237

238238
func getLintersSettingSections(node, nextNode *yaml.Node) (string, error) {
239-
linters, err := readJSONFile[[]*shared.LinterWrapper](filepath.Join("assets", "linters-info.json"))
239+
linters, err := readJSONFile[[]*types.LinterWrapper](filepath.Join("assets", "linters-info.json"))
240240
if err != nil {
241241
panic(err)
242242
}

scripts/website/expand_templates/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/golangci/golangci-lint/internal/renameio"
14-
"github.com/golangci/golangci-lint/scripts/website/shared"
14+
"github.com/golangci/golangci-lint/scripts/website/types"
1515
)
1616

1717
func main() {
@@ -129,7 +129,7 @@ func buildTemplateContext() (map[string]string, error) {
129129
return nil, fmt.Errorf("can't read .golangci.reference.yml: %w", err)
130130
}
131131

132-
helps, err := readJSONFile[shared.CLIHelp](filepath.Join("assets", "cli-help.json"))
132+
helps, err := readJSONFile[types.CLIHelp](filepath.Join("assets", "cli-help.json"))
133133
if err != nil {
134134
return nil, err
135135
}

scripts/website/shared/shared.go renamed to scripts/website/types/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package shared
1+
package types
22

33
import "github.com/golangci/golangci-lint/pkg/lint/linter"
44

0 commit comments

Comments
 (0)