Skip to content

Commit

Permalink
review: mygcl -> custom-gcl
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 6, 2024
1 parent d81d4d1 commit 1e9470b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ coverage.out
coverage.xml
/custom-golangci-lint
/gcl-custom
.mygcl.yml
.mygcl.yaml
.custom-gcl.yml
.custom-gcl.yaml
4 changes: 2 additions & 2 deletions docs/src/docs/plugins/module-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ An example linter can be found at [here](https://github.com/golangci/example-plu

## The Automatic Way

- define your building configuration into `.mygcl.yml`
- 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
Expand All @@ -17,7 +17,7 @@ Requirements:

### Configuration Example

```yaml title=.mygcl.yml
```yaml title=.custom-gcl.yml
version: v1.57.0
plugins:
# a plugin from a Go proxy
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/golangci/golangci-lint/pkg/logutils"
)

const envKeepTempFiles = "MYGCL_KEEP_TEMP_FILES"
const envKeepTempFiles = "CUSTOM_GCL_KEEP_TEMP_FILES"

type customCommand struct {
cmd *cobra.Command
Expand Down Expand Up @@ -57,7 +57,7 @@ func (c *customCommand) preRunE(_ *cobra.Command, _ []string) error {
func (c *customCommand) runE(_ *cobra.Command, _ []string) error {
ctx := context.Background()

tmp, err := os.MkdirTemp(os.TempDir(), "mygcl")
tmp, err := os.MkdirTemp(os.TempDir(), "custom-gcl")
if err != nil {
return fmt.Errorf("create temporary directory: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/internal/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (b Builder) goBuild(ctx context.Context, binaryName string) error {
cmd := exec.CommandContext(ctx, "go", "build",
"-ldflags",
fmt.Sprintf(
"-s -w -X 'main.version=%s-mygcl' -X 'main.date=%s'",
"-s -w -X 'main.version=%s-custom-gcl' -X 'main.date=%s'",
sanitizeVersion(b.cfg.Version), time.Now().UTC().String(),
),
"-o", binaryName,
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/internal/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"gopkg.in/yaml.v3"
)

const base = ".mygcl"
const base = ".custom-gcl"

const defaultBinaryName = "gcl-custom"
const defaultBinaryName = "custom-gcl"

// Configuration represents the configuration file.
type Configuration struct {
Expand Down

0 comments on commit 1e9470b

Please sign in to comment.