Skip to content

Commit

Permalink
Update CI and CONTRIBUTION.md
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Jun 21, 2023
1 parent 57a8f8f commit 0886867
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 32 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
- name: Lint package
uses: golangci/golangci-lint-action@v3
with:
args: --exclude ".*, make it a constant (goconst)"
version: latest

- name: Test package
Expand Down
12 changes: 4 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
concurrency: 4
timeout: 10m
issues-exit-code: 1
# Include test files or not, default is true
tests: true

# Output configuration options
Expand All @@ -19,19 +18,14 @@ linters-settings:
locale: US
ignore-words:
- noteable
unused:
# Treat code as a program (not a library) and report unused exported identifiers
check-exported: false

linters:
enable:
- asciicheck
- deadcode
- dogsled
- errorlint
- exportloopref
- goconst
- golint
- gosimple
- govet
- ineffassign
Expand All @@ -40,18 +34,20 @@ linters:
- nakedret
- nolintlint
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace
disable:
- errcheck
disable-all: false
fast: false

issues:
# List of regexps of issue texts to exclude.
exclude:
- "^.*, make it a constant$"

# Maximum issues count per one linter (set to 0 to disable)
max-issues-per-linter: 0

Expand Down
33 changes: 25 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
# How to Contribute

We want to make contributing to this project as easy as possible.
We want to make contributing to this project as easy as possible.

## Reporting Issues and Enhancements
## Reporting Issues

If you have an issue, please report it on the [issue tracker](https://github.com/xanzy/go-gitlab/issues)
If you have an issue, please report it on the [issue tracker](
https://github.com/xanzy/go-gitlab/issues).

If there is a documented feature within Gitlab
When you are up for writing a PR to solve the issue you encountered, it's not
needed to first open a separate issue. In that case only opening a PR with a
description of the issue you are trying to solve is just fine.

## Contributing Code

Pull requests are always welcome. If adding code that needs to be tested, try to add tests if there aren't any.
Pull requests are always welcome. When in doubt if your contribution fits in with
the rest of the project, free to first open an issue to discuss your idea.

We use [`gofumpt`](https://github.com/mvdan/gofumpt) to format this project.
This is not needed when fixing a bug or adding an enhancement, as long as the
enhancement you are trying to add can be found in the public GitLab API docs as
this project only supports what is in the public API docs.

## Coding style

We try to follow the Go best practices, where it makes sense, and use [`gofumpt`](
https://github.com/mvdan/gofumpt) to format code in this project.

Before making a PR, please look at the rest this package and try to make sure
your contribution is consistent with the rest of the coding style.

New struct field or methods should be placed (as much as possible) in the same
order as the ordering used in the public API docs. The idea is that this makes it
easier to find things.

### Setting up your local development environment to Contribute to `go-gitlab`

Expand All @@ -31,5 +49,4 @@ We use [`gofumpt`](https://github.com/mvdan/gofumpt) to format this project.
```sh
make test && make fmt
```
1. Open up your pull request

1. Open up your pull request
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
setup:
go mod tidy
@go install mvdan.cc/gofumpt@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
.PHONY: setup
##@ General

.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

test:
go test ./... -race #-v??
.PHONY: test
##@ Development

fmt:
fmt: ## Format code
@gofumpt -l -w .
.PHONY: fmt

lint:
@golangci-lint run --config .golangci.yml
.PHONY: lint
lint: ## Run linter
@golangci-lint run

setup: ## Setup your local environment
go mod tidy
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install mvdan.cc/gofumpt@latest
.PHONY: setup

test: ## Run tests
go test ./... -race
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0=
google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM=
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down

0 comments on commit 0886867

Please sign in to comment.