Skip to content

docs: improve grammar in the custom linter article #4489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .custom-gcl.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Require.
version: v1.56.2

# the name of the custom binary.
# The name of the custom binary.
# Optional.
# Default: custom-gcl
name: custom-golangci-lint
Expand Down
4 changes: 2 additions & 2 deletions docs/src/docs/contributing/new-linters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ Typically, these linters can't be open-sourced or too specific.

Such linters can be added through 2 plugin systems:

- [Go Plugin System](/plugins/module-plugins)
- [Module Plugin System](/plugins/go-plugins)
1. [Go Plugin System](/plugins/module-plugins)
2. [Module Plugin System](/plugins/go-plugins)
18 changes: 9 additions & 9 deletions docs/src/docs/plugins/module-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ An example linter can be found at [here](https://github.com/golangci/example-plu

## The Automatic Way

- define your building configuration into `.custom-gcl.yml`
- run the command `golangci-lint custom` ( or `golangci-lint custom -v` to have logs)
- define the plugin inside the `linters-settings.custom` section with the type `module`.
- run your custom version of golangci-lint
- Define your building configuration into `.custom-gcl.yml`.
- Run the command `golangci-lint custom` (or `golangci-lint custom -v` to have logs).
- Define the plugin inside the `linters-settings.custom` section with the type `module`.
- Run your custom version of golangci-lint.

Requirements:
- Go
Expand Down Expand Up @@ -47,11 +47,11 @@ linters:
## The Manual Way
- add a blank-import of your module inside `cmd/golangci-lint/plugins.go`
- run `go mod tidy`. (the module containing the plugin will be imported)
- run `make build`
- define the plugin inside the configuration `linters-settings.custom` section with the type `module`.
- run your custom version of golangci-lint
- Add a blank-import of your module inside `cmd/golangci-lint/plugins.go`.
- Run `go mod tidy` (the module containing the plugin will be imported).
- Run `make build`.
- Define the plugin inside the configuration `linters-settings.custom` section with the type `module`.
- Run your custom version of golangci-lint.

### Configuration Example

Expand Down
12 changes: 6 additions & 6 deletions pkg/commands/internal/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@ func NewBuilder(logger logutils.Log, cfg *Configuration, root string) *Builder {

// Build builds the custom binary.
func (b Builder) Build(ctx context.Context) error {
b.log.Infof("Cloning golangci-lint repository.")
b.log.Infof("Cloning golangci-lint repository")

err := b.clone(ctx)
if err != nil {
return fmt.Errorf("clone golangci-lint: %w", err)
}

b.log.Infof("Adding plugin imports.")
b.log.Infof("Adding plugin imports")

err = b.updatePluginsFile()
if err != nil {
return fmt.Errorf("update plugin file: %w", err)
}

b.log.Infof("Adding replace directives.")
b.log.Infof("Adding replace directives")

err = b.addReplaceDirectives(ctx)
if err != nil {
return fmt.Errorf("add replace directives: %w", err)
}

b.log.Infof("Running go mod tidy.")
b.log.Infof("Running go mod tidy")

err = b.goModTidy(ctx)
if err != nil {
return fmt.Errorf("go mod tidy: %w", err)
}

b.log.Infof("Building golangci-lint binary.")
b.log.Infof("Building golangci-lint binary")

binaryName := b.getBinaryName()

Expand All @@ -74,7 +74,7 @@ func (b Builder) Build(ctx context.Context) error {
return fmt.Errorf("build golangci-lint binary: %w", err)
}

b.log.Infof("Moving golangci-lint binary.")
b.log.Infof("Moving golangci-lint binary")

err = b.copyBinary(binaryName)
if err != nil {
Expand Down
Loading