Skip to content

Commit

Permalink
fix: bash completion and sort ordering (#10)
Browse files Browse the repository at this point in the history
Signed-off-by: tkrop <[email protected]>
  • Loading branch information
tkrop committed Jan 4, 2024
1 parent f089964 commit c225725
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
endif

GOBIN ?= $(shell go env GOPATH)/bin
GOMAKE ?= github.com/tkrop/[email protected].16
GOMAKE ?= github.com/tkrop/[email protected].17
TARGETS := $(shell command -v go-make >/dev/null || \
go install $(GOMAKE) && go-make targets)

Expand Down
6 changes: 3 additions & 3 deletions Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ TARGETS_LINT ?= lint-leaks? lint-$(CODE_QUALITY) lint-markdown lint-apis \
$(if $(filter $(CODACY),enabled),lint-codacy,)

INIT_MAKE ?= $(notdir $(FILE_MAKE) $(FILE_VARS))
UPDATE_MAKE ?= $(FILE_MAKE) $(FILE_GOLANGCI) $(FILE_MARKDOWN) \
$(FILE_GITLEAKS) $(FILE_CODACY) $(FILE_REVIVE)
UPDATE_MAKE ?= $(notdir $(FILE_MAKE) $(FILE_GOLANGCI) $(FILE_MARKDOWN) \
$(FILE_GITLEAKS) $(FILE_CODACY) $(FILE_REVIVE))

# Setup go to use desired and consistent go versions.
GOVERSION := $(shell go version | sed -E "s/.*go([0-9]+\.[0-9]+).*/\1/")
Expand Down Expand Up @@ -363,7 +363,7 @@ targets::
if [ "$(RUNARGS)" != "raw" ]; then awk -v RS= -F: ' \
/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ { \
if ($$1 !~ "^[#.]") { print $$1 } \
}' | sort -d | egrep -v -e '^[^[:alnum:]]'; \
}' | LC_ALL=C sort | egrep -v -e '^[^[:alnum:]]'; \
else cat -; fi || true;

#@ create a clone of the base repository to update from.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.16
0.0.17
2 changes: 1 addition & 1 deletion config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
endif

GOBIN ?= $(shell go env GOPATH)/bin
GOMAKE ?= github.com/tkrop/[email protected].16
GOMAKE ?= github.com/tkrop/[email protected].17
TARGETS := $(shell command -v go-make >/dev/null || \
go install $(GOMAKE) && go-make targets)

Expand Down
6 changes: 3 additions & 3 deletions config/Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ TARGETS_LINT ?= lint-leaks? lint-$(CODE_QUALITY) lint-markdown lint-apis \
$(if $(filter $(CODACY),enabled),lint-codacy,)

INIT_MAKE ?= $(notdir $(FILE_MAKE) $(FILE_VARS))
UPDATE_MAKE ?= $(FILE_MAKE) $(FILE_GOLANGCI) $(FILE_MARKDOWN) \
$(FILE_GITLEAKS) $(FILE_CODACY) $(FILE_REVIVE)
UPDATE_MAKE ?= $(notdir $(FILE_MAKE) $(FILE_GOLANGCI) $(FILE_MARKDOWN) \
$(FILE_GITLEAKS) $(FILE_CODACY) $(FILE_REVIVE))

# Setup go to use desired and consistent go versions.
GOVERSION := $(shell go version | sed -E "s/.*go([0-9]+\.[0-9]+).*/\1/")
Expand Down Expand Up @@ -363,7 +363,7 @@ targets::
if [ "$(RUNARGS)" != "raw" ]; then awk -v RS= -F: ' \
/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ { \
if ($$1 !~ "^[#.]") { print $$1 } \
}' | sort -d | egrep -v -e '^[^[:alnum:]]'; \
}' | LC_ALL=C sort | egrep -v -e '^[^[:alnum:]]'; \
else cat -; fi || true;

#@ create a clone of the base repository to update from.
Expand Down
2 changes: 1 addition & 1 deletion internal/make/fixtures/bash.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### bash completion for go-make
function __complete_go-make() {
COMPREPLY=($(compgen -W "$(go-make targets)" -- "${COMP_WORDS[COMP_CWORD]}"));
COMPREPLY=($(compgen -W "$(go-make targets 2>/dev/null)" -- "${COMP_WORDS[COMP_CWORD]}"));
}
complete -F __complete_go-make go-make;

28 changes: 14 additions & 14 deletions internal/make/fixtures/targets-trace.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ make --no-builtin-rules --no-builtin-variables --print-data-base \
if [ "" != "raw" ]; then awk -v RS= -F: ' \
/(^|\n)# Files(\n|$)/,/(^|\n)# Finished Make data base/ { \
if ($1 !~ "^[#.]") { print $1 } \
}' | sort -d | egrep -v -e '^[^[:alnum:]]'; \
}' | LC_ALL=C sort | egrep -v -e '^[^[:alnum:]]'; \
else cat -; fi || true;
all
all-clean
Expand Down Expand Up @@ -38,19 +38,19 @@ init-gosec
init-hooks
init-make
init-make!
init/Makefile
init/Makefile.vars
init-sources
init-staticcheck
init/Makefile
init/Makefile.vars
install
install-all
install-deadcode
install-gitleaks
install-go-make
install-gocognit
install-gocyclo
install-golangci-lint
install-gomajor
install-go-make
install-gosec
install-govulncheck
install-grype
Expand Down Expand Up @@ -112,11 +112,11 @@ uninstall-codacy-gosec
uninstall-codacy-staticcheck
uninstall-deadcode
uninstall-gitleaks
uninstall-go-make
uninstall-gocognit
uninstall-gocyclo
uninstall-golangci-lint
uninstall-gomajor
uninstall-go-make
uninstall-gosec
uninstall-govulncheck
uninstall-markdownlint
Expand All @@ -127,22 +127,19 @@ uninstall-staticcheck
uninstall-vegeta
uninstall-zally
update
update?
update-all
update-all?
update-deadcode
update-deps
update-deps?
update-gitleaks
update-go
update-go-make
update-go?
update-gocognit
update-gocyclo
update-golangci-lint
update-gomajor
update-go-make
update/go.mod
update/go.mod?
update-gosec
update-govulncheck
update-make
Expand All @@ -151,18 +148,21 @@ update-mock
update-mockgen
update-revive
update-staticcheck
update-tools
update-vegeta
update-zally
update/.codacy.yaml
update/.codacy.yaml?
update/.gitleaks.toml
update/.gitleaks.toml?
update/.golangci.yaml
update/.golangci.yaml?
update/Makefile
update/Makefile?
update/.markdownlint.yaml
update/.markdownlint.yaml?
update/Makefile
update/Makefile?
update/go.mod
update/go.mod?
update/revive.toml
update/revive.toml?
update-tools
update-vegeta
update-zally
update?
26 changes: 13 additions & 13 deletions internal/make/fixtures/targets.out
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ init-gosec
init-hooks
init-make
init-make!
init/Makefile
init/Makefile.vars
init-sources
init-staticcheck
init/Makefile
init/Makefile.vars
install
install-all
install-deadcode
install-gitleaks
install-go-make
install-gocognit
install-gocyclo
install-golangci-lint
install-gomajor
install-go-make
install-gosec
install-govulncheck
install-grype
Expand Down Expand Up @@ -104,11 +104,11 @@ uninstall-codacy-gosec
uninstall-codacy-staticcheck
uninstall-deadcode
uninstall-gitleaks
uninstall-go-make
uninstall-gocognit
uninstall-gocyclo
uninstall-golangci-lint
uninstall-gomajor
uninstall-go-make
uninstall-gosec
uninstall-govulncheck
uninstall-markdownlint
Expand All @@ -119,22 +119,19 @@ uninstall-staticcheck
uninstall-vegeta
uninstall-zally
update
update?
update-all
update-all?
update-deadcode
update-deps
update-deps?
update-gitleaks
update-go
update-go-make
update-go?
update-gocognit
update-gocyclo
update-golangci-lint
update-gomajor
update-go-make
update/go.mod
update/go.mod?
update-gosec
update-govulncheck
update-make
Expand All @@ -143,18 +140,21 @@ update-mock
update-mockgen
update-revive
update-staticcheck
update-tools
update-vegeta
update-zally
update/.codacy.yaml
update/.codacy.yaml?
update/.gitleaks.toml
update/.gitleaks.toml?
update/.golangci.yaml
update/.golangci.yaml?
update/Makefile
update/Makefile?
update/.markdownlint.yaml
update/.markdownlint.yaml?
update/Makefile
update/Makefile?
update/go.mod
update/go.mod?
update/revive.toml
update/revive.toml?
update-tools
update-vegeta
update-zally
update?
2 changes: 1 addition & 1 deletion internal/make/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
// bashCompletion contains the bash completion script for go-make.
BashCompletion = "### bash completion for go-make\n" +
"function __complete_go-make() {\n" +
" COMPREPLY=($(compgen -W \"$(go-make targets)\"" +
" COMPREPLY=($(compgen -W \"$(go-make targets 2>/dev/null)\"" +
" -- \"${COMP_WORDS[COMP_CWORD]}\"));\n" +
"}\n" +
"complete -F __complete_go-make go-make;\n"
Expand Down

0 comments on commit c225725

Please sign in to comment.