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 #234

Closed
atc0005 opened this issue Apr 26, 2020 · 0 comments · Fixed by #241
Closed

Replace external shell script calls with internal Makefile commands #234

atc0005 opened this issue Apr 26, 2020 · 0 comments · Fixed by #241
Assignees
Labels
builds enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Apr 26, 2020

Verbatim from atc0005/send2teams#41:

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 26, 2020
@atc0005 atc0005 added this to the v0.7.4 milestone Apr 26, 2020
@atc0005 atc0005 self-assigned this Apr 26, 2020
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - use same structure as other recent projects
  - use `-mod=vendor` to reflect Go 1.13 vendoring
  - replace two external shell scripts with equivalent
    embedded commands
  - Use automated Help menu

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - use same structure as other recent projects
  - use `-mod=vendor` to reflect Go 1.13 vendoring
  - replace two external shell scripts with equivalent
    embedded commands
  - Use automated Help menu

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for `atc0005/send2teams` project
  - generate binaries within `release_assets` subdirectory structure
  - dynamically determine go module path for version tag use
    - disabled for now as I have not moved this into a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go` commands to reflect Go 1.13 vendoring
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for `atc0005/send2teams` project
  - generate binaries within `release_assets` subdirectory structure
  - dynamically determine go module path for version tag use
    - disabled for now as I have not moved this into a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go` commands to reflect Go 1.13 vendoring
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for `atc0005/send2teams` project
  - generate binaries within `release_assets` subdirectory structure
  - dynamically determine go module path for version tag use
    - disabled for now as I have not moved this into a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go` commands to reflect Go 1.13 vendoring
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for `atc0005/send2teams` project
  - generate binaries within `release_assets` subdirectory structure
  - dynamically determine go module path for version tag use
    - disabled for now as I have not moved this into a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go` commands to reflect Go 1.13 vendoring
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for
    `atc0005/send2teams` project
  - generate binaries within `release_assets`
    subdirectory structure
  - dynamically determine go module path for version
    tag use
    - disabled for now as I have not moved this into
      a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go`
    commands to reflect Go 1.13 vendoring
    - this includes specifying `-mod=vendor` even for
      `go list` commands, which unless specified results
      in dependencies being donwloaded, even when they're
      alread provided in a local, top-level `vendor`
      directory
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
atc0005 added a commit that referenced this issue Apr 26, 2020
- Use `cmd/elbow` directory to match best practices

- Vendor dependencies

- Update Makefile
  - replace two external shell scripts with equivalent
    embedded commands
  - borrow heavily from existing `Makefile` for
    `atc0005/send2teams` project
  - generate binaries within `release_assets`
    subdirectory structure
  - dynamically determine go module path for version
    tag use
    - disabled for now as I have not moved this into
      a subpkg (e.g., `config`) yet
  - include `-mod=vendor` build flag for applicable `go`
    commands to reflect Go 1.13 vendoring
    - this includes specifying `-mod=vendor` even for
      `go list` commands, which unless specified results
      in dependencies being donwloaded, even when they're
      already provided in a local, top-level `vendor`
      directory
  - dynamic help/menu output based on recipe "doc comment"

- Update GitHub Actions Workflows
  - specify new cmd subdir path for builds
  - Disable running `go get` after checking out code
  - Exclude `vendor` folder from ...
    - Markdown linting checks
    - tests
    - basic build

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

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

refs #189, #232, #233, #234
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

Successfully merging a pull request may close this issue.

1 participant