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

Replace external shell script calls with internal Makefile commands #41

Closed
atc0005 opened this issue Apr 10, 2020 · 1 comment
Closed
Assignees
Labels
builds enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Apr 10, 2020

As I've begun doing with my other projects, I'd like to replace content like this:

linting:
	@echo "Calling wrapper script: $(LINTINGCMD)"
	@$(LINTINGCMD)
	@echo "Finished running linting checks"

with this:

.PHONY: linting
## linting: runs common linting checks
# https://stackoverflow.com/a/42510278/903870
linting:
	@echo "Running linting tools ..."

	@echo "Running gofmt ..."

	@test -z $(shell gofmt -l -e .) || (echo "WARNING: gofmt linting errors found" \
		&& gofmt -l -e -d . \
		&& exit 1 )

	@echo "Running go vet ..."
	@go vet ./...

	@echo "Running golint ..."
	@golint -set_exit_status ./...

	@echo "Running golangci-lint ..."
	@golangci-lint run \
		-E goimports \
		-E gosec \
		-E stylecheck \
		-E goconst \
		-E depguard \
		-E prealloc \
		-E misspell \
		-E maligned \
		-E dupl \
		-E unconvert \
		-E golint \
		-E gocritic

	@echo "Running staticcheck ..."
	@staticcheck ./...

	@echo "Finished running linting checks"

It's more verbose (though the golantci-lint options will be moved to an external config file before long), but hopefully more consolidated and clearer what is going on.

@atc0005 atc0005 added enhancement New feature or request builds labels Apr 10, 2020
@atc0005 atc0005 added this to the v0.3.0 milestone Apr 10, 2020
@atc0005 atc0005 self-assigned this Apr 10, 2020
atc0005 added a commit that referenced this issue Apr 10, 2020
- Update GitHub Actions Workflow
  - specify new cmd subdir path for builds

- Update `.gitignore`
  - add ignored paths for binaries
  - add `release_assets`

- Update `Makefile`
  - borrow heavily from existing `Makefile` for `atc0005/dnsc` project
  - generate binaries within `release_assets` subdirectory structure
  - dynamically determine go module path for version tag use
  - include `-mod=vendor` build flag for `go clean` command
  - dynamic help/menu output based on recipe "doc comment"

- prune `testing` subdirectory
  - the shell scripts within are no longer needed

- README
  - update one-off build examples to include new cmd subdirectory

refs #41, #40, #39, #38
@atc0005
Copy link
Owner Author

atc0005 commented Apr 10, 2020

Fixed by #43.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant