Skip to content

Commit

Permalink
feat: set quality control (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas authored and peterdeme committed Apr 27, 2022
1 parent a4eeab4 commit 400bb21
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Lint

on: [pull_request]

concurrency:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

Expand All @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.18"
go-version: '1.18'

- name: Tidy
run: go mod tidy -v && git diff --no-patch --exit-code || { git status; echo 'Unchecked diff, did you forget go mod tidy again?' ; false ; };
run: go mod tidy -v && git diff --no-patch --exit-code || { git status; echo 'Unchecked diff, did you forget go mod tidy again?' ; false ; };
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.bin/
build/
node_modules/

.idea
.vscode
.envrc
Expand Down
60 changes: 60 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
run:
go: '1.18'
deadline: 210s
timeout: 10m
skip-dirs:
- mocks
- '.*_mock'
skip-files:
- '.*_mock.go'
- ".*\\.pb\\.go$"

linters:
disable-all: true
enable:
- deadcode
- dupl
- errcheck
- forbidigo
- gas
- gci
- goconst
- gocritic
- gocyclo
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- unconvert
- revive
- staticcheck
- unused
- varcheck

linters-settings:
dupl:
threshold: 250
goconst:
min-len: 5
min-occurrences: 5
gocritic:
disabled-checks:
- ifElseChain
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
settings:
hugeParam:
sizeThreshold: 364
rangeValCopy:
sizeThreshold: 364
skipTestFuncs: true
gofumpt:
simplify: true
goimports:
local-prefixes: github.com/GetStream/stream-cli
31 changes: 21 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
NAME = stream-cli

$(NAME):
@go install ./cmd/$(NAME)

build:
@go build ./cmd/$(NAME)

test:
@go test -v ./...
NAME = stream-cli

GOLANGCI_VERSION = 1.45.0
GOLANGCI = .bin/golangci/$(GOLANGCI_VERSION)/golangci-lint
$(GOLANGCI):
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(dir $(GOLANGCI)) v$(GOLANGCI_VERSION)

lint: $(GOLANGCI) $(NAME)
$(GOLANGCI) -v run ./...

lint-fix: $(GOLANGCI) $(NAME)
$(GOLANGCI) -v run --fix ./...

$(NAME):
@go install ./cmd/$(NAME)

build:
@go build ./cmd/$(NAME)

test:
@go test -v ./...

0 comments on commit 400bb21

Please sign in to comment.