Skip to content

Commit

Permalink
#152 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Jul 10, 2024
1 parent 7109e9c commit 143fa71
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/linters/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
run:
modules-download-mode: readonly
show-stats: true
timeout: 10m

output:
print-linter-name: false
show-stats: true
sort-results: true

linters:
Expand Down
2 changes: 1 addition & 1 deletion .github/linters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- Used by [golangci-lint.yaml](../workflows/golangci-lint.yaml)
- [golangci-lint](https://golangci-lint.run/)
- [Configuration](https://golangci-lint.run/usage/configuration/)
- [Configuration](https://golangci-lint.run/usage/configuration/)

## .jscpd.json

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ hello-world: hello-world-osarch-specific
# -----------------------------------------------------------------------------

.PHONY: dependencies-for-make
make-dependencies:
dependencies-for-make:
@go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
@go install github.com/vladopajic/go-test-coverage/v2@latest
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.58.1
Expand All @@ -87,7 +87,7 @@ setup: setup-osarch-specific
# -----------------------------------------------------------------------------

.PHONY: lint
run-golangci-lint:
lint:
${GOBIN}/golangci-lint run --config=.github/linters/.golangci.yaml

# -----------------------------------------------------------------------------
Expand Down
13 changes: 6 additions & 7 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,28 @@ func Test_RunE(test *testing.T) {
require.NoError(test, err)
}


func Test_RootCmd(test *testing.T) {
_ = test
err := RootCmd.Execute()
testError(err)
require.NoError(test, err)
err = RootCmd.RunE(RootCmd, []string{})
testError(err)
require.NoError(test, err)
}

func Test_completionCmd(test *testing.T) {
_ = test
err := completionCmd.Execute()
testError(err)
require.NoError(test, err)
err = completionCmd.RunE(completionCmd, []string{})
testError(err)
require.NoError(test, err)
}

func Test_docsCmd(test *testing.T) {
_ = test
err := docsCmd.Execute()
testError(err)
require.NoError(test, err)
err = docsCmd.RunE(docsCmd, []string{})
testError(err)
require.NoError(test, err)
}

// ----------------------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion makefiles/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
# OS specific targets
# -----------------------------------------------------------------------------

.PHONY: build-osarch-specific
build-osarch-specific: darwin/amd64


.PHONY: clean-osarch-specific
clean-osarch-specific:
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true
@rm -f $(MAKEFILE_DIRECTORY)/coverage.html || true
@rm -f $(MAKEFILE_DIRECTORY)/coverage.out || true
@rm -f $(MAKEFILE_DIRECTORY)/cover.out || true
@rm -fr $(TARGET_DIRECTORY) || true
@rm -fr /tmp/sqlite || true

Expand Down
6 changes: 5 additions & 1 deletion makefiles/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/tmp/sqlite/G2C.db
# OS specific targets
# -----------------------------------------------------------------------------

.PHONY: build-osarch-specific
build-osarch-specific: linux/amd64


.PHONY: clean-osarch-specific
clean-osarch-specific:
@docker rm --force $(DOCKER_CONTAINER_NAME) 2> /dev/null || true
@docker rmi --force $(DOCKER_IMAGE_NAME) $(DOCKER_BUILD_IMAGE_NAME) 2> /dev/null || true
@rm -f $(GOPATH)/bin/$(PROGRAM_NAME) || true
@rm -f $(MAKEFILE_DIRECTORY)/coverage.html || true
@rm -f $(MAKEFILE_DIRECTORY)/coverage.out || true
@rm -f $(MAKEFILE_DIRECTORY)/cover.out || true
@rm -fr $(TARGET_DIRECTORY) || true
@rm -fr /tmp/sqlite || true

Expand Down
9 changes: 7 additions & 2 deletions makefiles/windows.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/C:\Temp\sqlite\G2C.db
# OS specific targets
# -----------------------------------------------------------------------------

.PHONY: build-osarch-specific
build-osarch-specific: windows/amd64
@mv $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME) $(TARGET_DIRECTORY)/windows-amd64/$(PROGRAM_NAME).exe


.PHONY: clean-osarch-specific
clean-osarch-specific:
del /F /S /Q $(GOPATH)/bin/$(PROGRAM_NAME)
del /F /S /Q $(MAKEFILE_DIRECTORY)/coverage.html
del /F /S /Q $(MAKEFILE_DIRECTORY)/coverage.out
del /F /S /Q $(MAKEFILE_DIRECTORY)/cover.out
del /F /S /Q $(TARGET_DIRECTORY)
del /F /S /Q C:\Temp\sqlite

Expand Down Expand Up @@ -46,7 +51,7 @@ setup-osarch-specific:
@mkdir C:\Temp\sqlite
@copy testdata\sqlite\G2C.db C:\Temp\sqlite\G2C.db
@mkdir $(TARGET_DIRECTORY)\
@mkdir $(TARGET_DIRECTORY)\$(GO_OS)-$(GO_ARCH)
@mkdir $(TARGET_DIRECTORY)\$(GO_OS)-$(GO_ARCH)


.PHONY: test-osarch-specific
Expand Down

0 comments on commit 143fa71

Please sign in to comment.