Skip to content
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

fix: syntax highlighting #563

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion action/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@

// check if the color flag is available
// and if it is set in the context

if strings.Contains(f, internal.FlagColor) &&
!ctx.IsSet(internal.FlagColor) {
// set the color field to value from config
Expand All @@ -200,8 +201,8 @@
if config.Color != nil && !*config.Color {
c = "false"
}
err = ctx.Set(internal.FlagColor, c)

Check failure on line 204 in action/config/load.go

View workflow job for this annotation

GitHub Actions / diff-review

assignments should only be cuddled with other assignments (wsl)

Check failure on line 204 in action/config/load.go

View workflow job for this annotation

GitHub Actions / full-review

assignments should only be cuddled with other assignments (wsl)

Check failure on line 204 in action/config/load.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] action/config/load.go#L204

assignments should only be cuddled with other assignments (wsl)
Raw output
action/config/load.go:204:4: assignments should only be cuddled with other assignments (wsl)
			err = ctx.Set(internal.FlagColor, c)
			^
if err != nil {

Check failure on line 205 in action/config/load.go

View workflow job for this annotation

GitHub Actions / diff-review

only one cuddle assignment allowed before if statement (wsl)

Check failure on line 205 in action/config/load.go

View workflow job for this annotation

GitHub Actions / full-review

only one cuddle assignment allowed before if statement (wsl)

Check failure on line 205 in action/config/load.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] action/config/load.go#L205

only one cuddle assignment allowed before if statement (wsl)
Raw output
action/config/load.go:205:4: only one cuddle assignment allowed before if statement (wsl)
			if err != nil {
			^
return err
}

Expand All @@ -226,7 +227,7 @@
// and if it is set in the context
if strings.Contains(f, internal.FlagColorTheme) &&
!ctx.IsSet(internal.FlagColorTheme) &&
len(config.ColorFormat) > 0 {
len(config.ColorTheme) > 0 {
// set the color theme field to value from config
err = ctx.Set(internal.FlagColorTheme, config.ColorTheme)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/vela-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ func main() {
&cli.StringFlag{
EnvVars: []string{"VELA_COLOR_FORMAT"},
Name: internal.FlagColorFormat,
Usage: "enable or disable color output",
Usage: "overrides the output color format (default: terminal256)",
},

&cli.StringFlag{
EnvVars: []string{"VELA_COLOR_THEME"},
Name: internal.FlagColorTheme,
Usage: "configures the output color theme",
Usage: "configures the output color theme (default: monokai)",
},
}

Expand Down
2 changes: 2 additions & 0 deletions command/settings/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/go-vela/cli/action/settings"
"github.com/go-vela/cli/internal"
"github.com/go-vela/cli/internal/client"
"github.com/go-vela/cli/internal/output"
)

// CommandView defines the command for inspecting the platform settings record.
Expand Down Expand Up @@ -62,6 +63,7 @@ func view(c *cli.Context) error {
s := &settings.Config{
Action: internal.ActionView,
Output: c.String(internal.FlagOutput),
Color: output.ColorOptionsFromCLIContext(c),
}

// validate settings configuration
Expand Down
Loading