Skip to content

Commit

Permalink
Update repository setup
Browse files Browse the repository at this point in the history
Update command markdown files to latest version.

Clean-up `Makefile`.

Move static checks into separate GitHub Action.

Make Logo smaller.
  • Loading branch information
HeavyWombat committed Oct 18, 2022
1 parent 2f1f87f commit ca70166
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 43 deletions.
1 change: 0 additions & 1 deletion .docs/commands/havener.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ See the individual commands to get the complete overview.
* [havener version](havener_version.md) - Shows the version
* [havener watch](havener_watch.md) - Watch status of all pods in all namespaces

###### Auto generated by spf13/cobra on 18-Feb-2021
1 change: 0 additions & 1 deletion .docs/commands/havener_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ havener events [flags]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
3 changes: 1 addition & 2 deletions .docs/commands/havener_logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ havener logs [flags]
-h, --help help for logs
--no-config-files exclude configuration files in download package
--parallel int number of parallel download jobs (default 64)
--target string desired target download location for retrieved files (default "/var/folders/dc/1k_907394hx5mft__7g269vh0000gn/T/")
--target string desired target download location for retrieved files (default "/tmp")
--timeout int allowed time in seconds before the download is aborted (default 300)
```

Expand All @@ -43,4 +43,3 @@ havener logs [flags]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
12 changes: 6 additions & 6 deletions .docs/commands/havener_node-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ havener node-exec [flags] [<node>[,<node>,...]] [<command>]
### Options

```
--block show distributed shell output as block for each node
-h, --help help for node-exec
--image string set image for helper pod from which the root-shell is accessed (default "alpine")
--no-tty do not allocate pseudo-terminal for command execution
--timeout int set timout in seconds for the setup of the helper pod (default 10)
--block show distributed shell output as block for each node
-h, --help help for node-exec
--image string set image for helper pod from which the root-shell is accessed (default "alpine")
--max-parallel int number of parallel executions (defaults to number of nodes)
--no-tty do not allocate pseudo-terminal for command execution
--timeout int set timout in seconds for the setup of the helper pod (default 10)
```

### Options inherited from parent commands
Expand All @@ -59,4 +60,3 @@ havener node-exec [flags] [<node>[,<node>,...]] [<command>]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
1 change: 0 additions & 1 deletion .docs/commands/havener_pod-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ havener pod-exec [flags] [[<namespace>/]<pod>[/container]] [<command>]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
1 change: 0 additions & 1 deletion .docs/commands/havener_top.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ havener top [flags]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
1 change: 0 additions & 1 deletion .docs/commands/havener_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ havener version [flags]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
1 change: 0 additions & 1 deletion .docs/commands/havener_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ havener watch [flags]

* [havener](havener.md) - Convenience wrapper around some kubectl commands

###### Auto generated by spf13/cobra on 18-Feb-2021
Binary file modified .docs/images/havener-top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .docs/images/havener-watch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 4 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,17 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.19.x

- name: Install Tools
run: |
go install github.com/gordonklaus/ineffassign@latest
go install golang.org/x/lint/golint@latest
go install github.com/client9/misspell/cmd/misspell@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/onsi/ginkgo/ginkgo@latest
- run: go build ./...
- run: go vet ./...
- run: ineffassign ./...
- run: golint ./...
- run: find . -type f | xargs misspell -source=text -error
- run: staticcheck ./...

- name: Run Go Unit Tests
run: |
ginkgo -r -randomizeAllSpecs -randomizeSuites -failOnPending -nodes=1 -compilers=1 -race -trace -cover
- name: Run Unit Tests
run: make unit-test

- name: Upload Code Coverage Profile
uses: codecov/codecov-action@v1
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: golangci-lint

on:
push:
tags-ignore:
- '**'
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Build source code
run: go build ./...

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
only-new-issues: true
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,30 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

.PHONY: all clean todo-list lint misspell vet unit-test docker-build-test test

.PHONY: default
default: test

.PHONY: all
all: test

.PHONY: clean
clean:
@rm -rf dist
@go clean -cache $(shell go list ./...)

.PHONY: todo-list
todo-list:
@grep -InHR --exclude-dir=vendor --exclude-dir=.git '[T]ODO ' $(shell pwd)

.PHONY: lint
lint:
@echo 'Linting packages'
@golint ./...
@golangci-lint run

.PHONY: misspell
misspell:
@echo 'Spellchecking files'
@find . -type f \( -name "*.go" -o -name "*.md" \) -print0 | xargs -0 misspell -error

vet:
@echo 'Vetting packages'
@go vet ./...

.PHONY: unit-test
unit-test:
@go run github.com/onsi/ginkgo/v2/ginkgo \
--coverprofile=unit.coverprofile \
Expand All @@ -56,10 +55,13 @@ unit-test:
--trace \
./...

test: lint misspell vet unit-test
.PHONY: test
test: lint misspell unit-test

.PHONY: gen-docs
gen-docs:
rm -f .docs/commands/*.md
go run cmd/gendocs/docs.go
TMPDIR=/tmp go run cmd/gendocs/docs.go
perl -pi -e "s:$(HOME):~:g" .docs/commands/*.md # omit username in docs
perl -pi -e 's/\e\[[0-9;]*m//g' .docs/commands/*.md # remove ANSI sequences
perl -ni -e 'print unless m/^###### Auto generated by/' .docs/commands/*.md # remove generated by line

0 comments on commit ca70166

Please sign in to comment.