Skip to content

Commit

Permalink
Keep comment line width below 80 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Sep 2, 2023
1 parent e083b13 commit fab9f86
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 34 deletions.
31 changes: 16 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ We want to make contributing to this project as easy as possible.

## 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).

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
Expand All @@ -22,8 +21,10 @@ 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.
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.
As a general rule of thumb we prefer to keep line width for comments below 80
chars and for code (where possible and sensible) below 100 chars.

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.
Expand All @@ -35,18 +36,18 @@ easier to find things.
### Setting up your local development environment to Contribute to `go-gitlab`

1. [Fork](https://github.com/xanzy/go-gitlab/fork), then clone the repository.
```sh
git clone https://github.com/<your-username>/go-gitlab.git
# or via ssh
git clone git@github.com:<your-username>/go-gitlab.git
```
```sh
git clone https://github.com/<your-username>/go-gitlab.git
# or via ssh
git clone git@github.com:<your-username>/go-gitlab.git
```
1. Install dependencies:
```sh
make setup
```
```sh
make setup
```
1. Make your changes on your feature branch
1. Run the tests and `gofumpt`
```sh
make test && make fmt
```
```sh
make test && make fmt
```
1. Open up your pull request
41 changes: 22 additions & 19 deletions group_protected_environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"net/http"
)

// GroupProtectedEnvironmentsService handles communication with the group-level protected
// environment methods of the GitLab API.
// GroupProtectedEnvironmentsService handles communication with the group-level
// protected environment methods of the GitLab API.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html
Expand All @@ -41,8 +41,8 @@ type GroupProtectedEnvironment struct {
ApprovalRules []*GroupEnvironmentApprovalRule `json:"approval_rules"`
}

// GroupEnvironmentAccessDescription represents the access decription for a group-level protected
// environment.
// GroupEnvironmentAccessDescription represents the access decription for a
// group-level protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html
Expand All @@ -54,8 +54,8 @@ type GroupEnvironmentAccessDescription struct {
GroupID int `json:"group_id"`
}

// GroupEnvironmentApprovalRule represents the approval rules for a group-level protected
// environment.
// GroupEnvironmentApprovalRule represents the approval rules for a group-level
// protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#protect-a-single-environment
Expand All @@ -76,8 +76,8 @@ type GroupEnvironmentApprovalRule struct {
// https://docs.gitlab.com/ee/api/group_protected_environments.html#list-group-level-protected-environments
type ListGroupProtectedEnvironmentsOptions ListOptions

// ListGroupProtectedEnvironments returns a list of protected environments from a
// group.
// ListGroupProtectedEnvironments returns a list of protected environments from
// a group.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#list-group-level-protected-environments
Expand All @@ -102,7 +102,8 @@ func (s *GroupProtectedEnvironmentsService) ListGroupProtectedEnvironments(gid i
return pes, resp, nil
}

// GetGroupProtectedEnvironment returns a single group-level protected environment.
// GetGroupProtectedEnvironment returns a single group-level protected
// environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#get-a-single-protected-environment
Expand Down Expand Up @@ -139,8 +140,8 @@ type ProtectGroupEnvironmentOptions struct {
ApprovalRules *[]*GroupEnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"`
}

// GroupEnvironmentAccessOptions represents the options for an access decription for
// a group-level protected environment.
// GroupEnvironmentAccessOptions represents the options for an access decription
// for a group-level protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#protect-a-single-environment
Expand All @@ -150,8 +151,8 @@ type GroupEnvironmentAccessOptions struct {
GroupID *int `url:"group_id,omitempty" json:"group_id,omitempty"`
}

// GroupEnvironmentApprovalRuleOptions represents the approval rules for a group-level protected
// environment.
// GroupEnvironmentApprovalRuleOptions represents the approval rules for a
// group-level protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#protect-a-single-environment
Expand Down Expand Up @@ -201,8 +202,8 @@ type UpdateGroupProtectedEnvironmentOptions struct {
ApprovalRules *[]*UpdateGroupEnvironmentApprovalRuleOptions `url:"approval_rules,omitempty" json:"approval_rules,omitempty"`
}

// UpdateGroupEnvironmentAccessOptions represents the options for updates to the access decription for
// a group-level protected environment.
// UpdateGroupEnvironmentAccessOptions represents the options for updates to the
// access decription for a group-level protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#update-a-protected-environment
Expand All @@ -214,8 +215,8 @@ type UpdateGroupEnvironmentAccessOptions struct {
Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"`
}

// UpdateGroupEnvironmentApprovalRuleOptions represents the updates to the approval rules for a group-level
// protected environment.
// UpdateGroupEnvironmentApprovalRuleOptions represents the updates to the
// approval rules for a group-level protected environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#update-a-protected-environment
Expand All @@ -230,7 +231,8 @@ type UpdateGroupEnvironmentApprovalRuleOptions struct {
Destroy *bool `url:"_destroy,omitempty" json:"_destroy,omitempty"`
}

// UpdateGroupProtectedEnvironment updates a single group-level protected environment.
// UpdateGroupProtectedEnvironment updates a single group-level protected
// environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#update-a-protected-environment
Expand All @@ -255,7 +257,8 @@ func (s *GroupProtectedEnvironmentsService) UpdateGroupProtectedEnvironment(gid
return pe, resp, nil
}

// UnprotectGroupEnvironment unprotects the given protected group-level environment.
// UnprotectGroupEnvironment unprotects the given protected group-level
// environment.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/group_protected_environments.html#unprotect-a-single-environment
Expand Down

0 comments on commit fab9f86

Please sign in to comment.