forked from amp-labs/connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (30 loc) · 1.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# ====================
# Formatting & linting
# ====================
.PHONY: lint
lint:
golangci-lint run -c .golangci.yml
# Run a few autoformatters and print out unfixable errors
# PRE-REQUISITES: install linters, see https://ampersand.slab.com/posts/engineering-onboarding-guide-environment-set-up-9v73t3l8#huik9-install-linters
# If you're curious, run `golangci-lint help linters` to see which linters have auto-fix enabled by golangci-lint.
# For ones that do not have auto-fix enabled by golangci-lint (e.g. wsl and gci), we add the fix commands manually to this list.
.PHONY: fix
fix:
wsl --allow-cuddle-declarations --fix ./... && \
gci write . && \
golangci-lint run -c .golangci.yml --fix
.PHONY: fix/sort
fix/sort:
make fix | grep "" | sort
# Alias for fix
.PHONY: format
format: fix
.PHONY: test
test:
go test -v ./...
# Creates PR URLs for each template
# Click on one of them or manually add ?template=<file.md> to the URL if you are creating a PR via the Github website
# Templates: Under github/PULL_REQUEST_TEMPLATE directory you can add more templates
.PHONY: pr-template
pr-template:
. ./scripts/bash/pr_options.sh; pr_template