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

chore(deps): update go version to 1.21.5 #1021

Merged
merged 8 commits into from
Dec 11, 2023
Merged
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
Prev Previous commit
remove usage of TESTING env var
loderunner committed Dec 11, 2023
commit c12ab397aff0f5be8ce07e15dc33e36ab24a202b
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -93,7 +93,6 @@ jobs:
command: |
export GOBIN=/c/go/bin
export PATH=$GOBIN:$PATH
export TESTING="true"
go install gotest.tools/gotestsum@latest
gotestsum --junitfile test_results/windows.xml
- store_test_results:
@@ -136,8 +135,6 @@ jobs:
- run:
command: bundle exec cucumber
working_directory: integration_tests
environment:
TESTING: "true"
- run:
name: "Make sure simple command do not cause any timeout"
command: circleci version
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -18,11 +18,11 @@ clean:

.PHONY: test
test:
TESTING=true go test -v ./...
go test -v ./...

.PHONY: cover
cover:
TESTING=true go test -race -coverprofile=coverage.txt ./...
go test -race -coverprofile=coverage.txt ./...

.PHONY: lint
lint:
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

tasks:
lint:
@@ -21,7 +21,7 @@ tasks:
test:
desc: Run the tests
cmds:
- TESTING=true go test -v ./...
- go test -v ./...

tidy:
desc: Run 'go mod tidy' to clean up module files.
@@ -59,4 +59,4 @@ tasks:
cover:
desc: tests and generates a cover profile
cmds:
- TESTING=true go test -race -coverprofile=coverage.txt ./...
- go test -race -coverprofile=coverage.txt ./...
25 changes: 12 additions & 13 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -22,10 +22,12 @@ import (
"golang.org/x/term"
)

var defaultEndpoint = "graphql-unstable"
var defaultHost = "https://circleci.com"
var defaultRestEndpoint = "api/v2"
var trueString = "true"
var (
defaultEndpoint = "graphql-unstable"
defaultHost = "https://circleci.com"
defaultRestEndpoint = "api/v2"
trueString = "true"
)

// rootCmd is used internally and global to the package but not exported
// therefore we can use it in other commands, like `usage`
@@ -142,10 +144,8 @@ func MakeCommands() *cobra.Command {
cobra.AddTemplateFunc("PositionalArgs", md_docs.PositionalArgs)
cobra.AddTemplateFunc("FormatPositionalArg", md_docs.FormatPositionalArg)

if os.Getenv("TESTING") != trueString {
helpCmd := helpCmd{width: helpWidth}
rootCmd.SetHelpFunc(helpCmd.helpTemplate)
}
helpCmd := helpCmd{width: helpWidth}
rootCmd.SetHelpFunc(helpCmd.helpTemplate)
rootCmd.SetUsageTemplate(usageTemplate)
rootCmd.DisableAutoGenTag = true

@@ -351,7 +351,6 @@ type helpCmd struct {

// helpTemplate Building a custom help template with more finesse and pizazz
func (helpCmd *helpCmd) helpTemplate(cmd *cobra.Command, s []string) {

/***Styles ***/
titleStyle := lipgloss.NewStyle().Bold(true).
Foreground(lipgloss.AdaptiveColor{Light: `#003740`, Dark: `#3B6385`}).
@@ -369,14 +368,14 @@ func (helpCmd *helpCmd) helpTemplate(cmd *cobra.Command, s []string) {
/** Building Usage String **/
usageText := strings.Builder{}

//get command path
// get command path
usageText.WriteString(titleStyle.Render(cmd.CommandPath()))

//get command short or long
// get command short or long
cmdDesc := titleStyle.Render(cmd.Long)
if strings.TrimSpace(cmdDesc) == "" || cmd.Name() == "circleci" {
if cmd.Name() == "circleci" {
cmdDesc += "\n\n" //add some spaces for circleci command
cmdDesc += "\n\n" // add some spaces for circleci command
}
cmdDesc += subCmdStyle.Render(cmd.Short)
}
@@ -424,7 +423,7 @@ func (helpCmd *helpCmd) helpTemplate(cmd *cobra.Command, s []string) {
usageText.WriteString(flags)
}

//Border styles
// Border styles
borderStyle := lipgloss.NewStyle().
Padding(0, 1, 0, 1).
Width(helpCmd.width - 2).