Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
extended: configure the release process
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Nov 30, 2023
1 parent 6d3542b commit b010f16
Show file tree
Hide file tree
Showing 7 changed files with 1,002 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
repository:
has_wiki: false
has_issues: true
has_projects: false

allow_forking: true

allow_merge_commit: false
allow_squash_merge: true
use_squash_pr_title_as_default: true
allow_rebase_merge: true
allow_update_branch: false
allow_auto_merge: false
delete_branch_on_merge: true

default_branch: main

enable_vulnerability_alerts: true
enable_automated_security_fixes: true

branches:
- name: main
protection:
required_linear_history: true

labels:
- name: 'type: bug'
color: '#DA0064'
description: |
A new bug report.
- name: 'type: feature'
color: '#9510AC'
description: |
A new feature request.
- name: 'type: improvement'
color: '#0CA789'
description: |
A new improvement proposal.
- name: 'severity: critical'
color: '#F24727'
description: |
A bug has critical severity and needs to be fixed as soon as possible.
- name: 'severity: major'
color: '#EF8D79'
description: |
A bug has major severity and needs to be fixed in the nearest iteration.
- name: 'severity: minor'
color: '#FBC7BD'
description: |
A bug has minor severity and should be fixed when possible.
- name: 'scope: code'
color: '#808080'
description: |
An issue related to source code.
- name: 'scope: deps'
color: '#949494'
description:
An issue related to dependencies.
- name: 'scope: docs'
color: '#ADADAD'
description: |
An issue related to documentation.
- name: 'scope: test'
color: '#D9D9D9'
description: |
An issue related to tests.
- name: 'scope: inventory'
color: '#EAEAEA'
description: |
An issue related to auxiliary code, e.g. CI config, Makefiles, etc.
- name: 'impact: high'
color: '#652CB3'
description: |
An issue has high impact.
- name: 'impact: medium'
color: '#A380D1'
description: |
An issue has medium impact.
- name: 'impact: low'
color: '#CAB9E1'
description: |
An issue has low impact.
- name: 'effort: hard'
color: '#414BB2'
description: |
An issue is hard to implement or reproduce.
- name: 'effort: medium'
color: '#8D93D1'
description: |
An issue has a medium complexity.
- name: 'effort: easy'
color: '#C6C9E8'
description: |
An issue is easy to implement.
- name: 'status: pending'
color: '#2D9BF1'
description: |
Mark an issue as hold.
- name: 'status: stale'
color: '#3A3A3A'
description: |
Mark an issue as stale.
- name: duplicate
color: '#F8961E'
description: |
An issue or pull request already exists.
- name: good first issue
color: '#90BE6D'
description: |
Good for newcomers.
- name: help wanted
color: '#577590'
description: |
Extra attention is needed.
- name: invalid
color: '#F94144'
description: |
This doesn't seem right.
- name: question
color: '#43AA8B'
description: |
Further information is requested.
- name: wontfix
color: '#F9C74F'
description: |
This will not be worked on.
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
project_name: goimports

archives:
- id: goimports
files:
- LICENSE
- PATENTS
format: tar.gz
name_template: "{{.Binary}}_{{.Version}}_{{.Os}}-{{.Arch}}"

brews:
- name: goimports
caveats: ''
commit_author:
name: Kamil Samigullin
email: kamil@samigullin.info
description: |
Command goimports updates your Go import lines,
adding missing ones and removing unreferenced ones.
In addition to fixing imports, goimports also formats
your code in the same style as gofmt so it can be used
as a replacement for your editor's gofmt-on-save hook.
folder: Formula
homepage: https://goimports.octolab.org/
repository:
owner: octolab
name: homebrew-tap
install: |
bin.install "goimports"
prefix.install_metafiles
builds:
- id: goimports
binary: goimports
env:
- CGO_ENABLED=0
flags:
- -trimpath
goarch:
- amd64
- arm64
goos:
- darwin
- linux
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
main: ./cmd/goimports

checksum: { name_template: checksums.txt }

release:
github:
owner: kamilsk
name: go-tools
58 changes: 58 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Motivation

As a Go developer, I actively use `goimports` as a code formatter, but it has
non-deterministic behavior that affects a final diff. For example, for the input
```go
import (
"context"
"github.com/pkg/b"
"github.com/pkg/a"

"github.com/pkg/y"
"github.com/pkg/x"
"github.com/pkg/z"
)
```
the output will be
```go
import (
"context"

"github.com/pkg/a"
"github.com/pkg/b"

"github.com/pkg/x"
"github.com/pkg/y"
"github.com/pkg/z"
)
```
The proper result for me is
```go
import (
"context"

"github.com/pkg/a"
"github.com/pkg/b"
"github.com/pkg/x"
"github.com/pkg/y"
"github.com/pkg/z"
)
```
So, I need to patch its behaviour and make a result deterministic.

## What's changed

- The `goimports` has the deterministic behaviour.
- The tool is available by `brew install octolab/tap/goimports`.
- The installation is also possible by
```bash
$ curl -sSfL https://install.octolab.org/goimports | sh -s -- -b /usr/local/bin
```

## Related issues

- https://github.com/golang/tools/pull/68
- https://github.com/golang/tools/pull/308
- https://github.com/golang/tools/compare/master...kamilsk:extended

<p align="right">made with ❤️ for everyone by <a href="https://www.octolab.org/">OctoLab</a></p>
Loading

0 comments on commit b010f16

Please sign in to comment.