Skip to content

Commit

Permalink
Updated labels, mergify, makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Aug 18, 2021
1 parent 2329546 commit fb3db1d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 24 deletions.
11 changes: 10 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@
name: "update"
- color: FFA500
description: "Any significant refactoring"
name: "refactor"
name: "refactor"
- color: FEF2C0
description: "Used for automatic merging"
name: "automerge"
- color: FBCA04
description: "Used for denoting a WIP, stops auto-merge"
name: "work-in-progress"
- color: c2e0c6
description: "Old, unused, stale"
name: "stale"
22 changes: 12 additions & 10 deletions .mergify.yml → .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pull_request_rules:
- check-success='test (1.14.x, ubuntu-latest)'
- check-success='test (1.15.x, ubuntu-latest)'
- check-success='test (1.16.x, ubuntu-latest)'
- check-success='test (1.17.x, ubuntu-latest)'
- check-success='Analyze (go)'
- title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
Expand All @@ -25,6 +26,7 @@ pull_request_rules:
- check-success='test (1.14.x, ubuntu-latest)'
- check-success='test (1.15.x, ubuntu-latest)'
- check-success='test (1.16.x, ubuntu-latest)'
- check-success='test (1.17.x, ubuntu-latest)'
- check-success='Analyze (go)'
- -title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
actions:
Expand All @@ -38,6 +40,12 @@ pull_request_rules:
- name: Automatic Merge ⬇️ on Approval ✔
conditions:
- "#approved-reviews-by>=1"
- check-success='test (1.14.x, ubuntu-latest)'
- check-success='test (1.15.x, ubuntu-latest)'
- check-success='test (1.16.x, ubuntu-latest)'
- check-success='test (1.17.x, ubuntu-latest)'
- check-success='Analyze (go)'
- label!=work-in-progress
- -draft
actions:
merge:
Expand Down Expand Up @@ -159,11 +167,11 @@ pull_request_rules:
- author!=mergify[bot]
- author!=mrz1836
- author!=rohenaz
- author!=galt-tr
actions:
comment:
message: |
Welcome to our open-source project!
We're delighted to have you onboard 💘
Welcome to our open-source project! 💘
# ===============================================================================
# STALE BRANCHES
Expand All @@ -178,6 +186,8 @@ pull_request_rules:
close:
message: |
This pull request looks stale. Feel free to reopen it if you think it's a mistake.
label:
add: [ "stale" ]

# ===============================================================================
# BRANCHES
Expand All @@ -189,14 +199,6 @@ pull_request_rules:
actions:
delete_head_branch:

#- name: automatic update for PR marked as “Ready-to-Go“
# conditions:
# - -conflict # skip PRs with conflicts
# - -draft # filter-out GH draft PRs
# - label="Ready-to-Go"
# actions:
# update:

# ===============================================================================
# CONVENTION
# ===============================================================================
Expand Down
18 changes: 9 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# options for analysis running
run:
# default concurrency is a available CPU number
# default concurrency is an available CPU number
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
Expand All @@ -22,7 +22,7 @@ run:
# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
# of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work
# on Windows.
skip-dirs:
Expand Down Expand Up @@ -192,7 +192,7 @@ linters-settings:
# See the License for the specific language governing permissions and
# limitations under the License.
template-path:
# also as alternative of directive 'template' you may put the path to file with the template source
# also, as alternative of directive 'template' you may put the path to file with the template source
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
Expand Down Expand Up @@ -245,7 +245,7 @@ linters-settings:
- bsv
- bitcoin
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
# make an issue if func has more lines of code than this setting, and it has naked returns; default is 30
max-func-lines: 30
prealloc:
# XXX: we don't recommend using this linter before doing performance profiling.
Expand Down Expand Up @@ -290,7 +290,7 @@ linters-settings:
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
wsl:
# If true append is only allowed to be cuddled if appending value is
# matching variables, fields or types on line above. Default is true.
# matching variables, fields or types on the line above. Default is true.
strict-append: true
# Allow calls and assignments to be cuddled as long as the lines have any
# matching variables, fields or types. Default is true.
Expand All @@ -308,7 +308,7 @@ linters-settings:
# Allow leading comments to be separated with empty liens
allow-separated-leading-comment: false
gofumpt:
# Choose whether or not to use the extra rules that are disabled
# Choose whether to use the extra rules that are disabled
# by default
extra-rules: false

Expand Down Expand Up @@ -362,7 +362,7 @@ linters:

issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
Expand Down Expand Up @@ -396,7 +396,7 @@ issues:
- lll
source: "^//go:generate "

# Independently from option `exclude` we use default exclude patterns,
# Independently of option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
Expand Down Expand Up @@ -438,7 +438,7 @@ severity:
default-severity: error

# The default value is false.
# If set to true severity-rules regular expressions become case sensitive.
# If set to true severity-rules regular expressions become case-sensitive.
case-sensitive: false

# Default value is empty list.
Expand Down
14 changes: 10 additions & 4 deletions .make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DARWIN=$(BINARY_NAME)-darwin
LINUX=$(BINARY_NAME)-linux
WINDOWS=$(BINARY_NAME)-windows.exe

.PHONY: test lint vet install
.PHONY: test lint vet install generate

bench: ## Run all benchmarks in the Go application
@go test -bench=. -benchmem
Expand All @@ -27,6 +27,9 @@ clean-mods: ## Remove all the Go mod cache
coverage: ## Shows the test coverage
@go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out

generate: ## Runs the go generate command in the base of the repo
@go generate -v

godocs: ## Sync the latest tag with GoDocs
@test $(GIT_DOMAIN)
@test $(REPO_OWNER)
Expand All @@ -42,11 +45,11 @@ install-go: ## Install the application (Using Native Go)

lint: ## Run the golangci-lint application (install if not found)
@#Travis (has sudo)
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.41.1 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ $(TRAVIS) ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.0 && sudo cp ./bin/golangci-lint $(go env GOPATH)/bin/; fi;
@#AWS CodePipeline
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(CODEBUILD_BUILD_ID)" != "" ]; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
@#Github Actions
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.41.1; fi;
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(GITHUB_WORKFLOW)" != "" ]; then curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.42.0; fi;
@#Brew - MacOS
@if [ "$(shell command -v golangci-lint)" = "" ] && [ "$(shell command -v brew)" != "" ]; then brew install golangci-lint; fi;
@echo "running golangci-lint..."
Expand All @@ -57,6 +60,9 @@ test: ## Runs vet, lint and ALL tests
@echo "running tests..."
@go test ./... -v

test-unit: ## Runs tests and outputs coverage
@go test ./... -race -coverprofile=coverage.txt -covermode=atomic

test-short: ## Runs vet, lint and tests (excludes integration tests)
@$(MAKE) lint
@echo "running tests (short)..."
Expand Down

0 comments on commit fb3db1d

Please sign in to comment.