Skip to content

Commit 973002d

Browse files
authored
Update golangci-lint to v1.46.2 (#37)
1 parent df35ad5 commit 973002d

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

.github/workflows/cloc.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
# This script is provided by github.com/bool64/dev.
12
name: cloc
23
on:
34
pull_request:
5+
6+
# Cancel the workflow in progress in newer build is about to start.
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
411
jobs:
512
cloc:
613
runs-on: ubuntu-latest
@@ -17,19 +24,19 @@ jobs:
1724
- name: Count Lines Of Code
1825
id: loc
1926
run: |
20-
curl -OL https://github.com/vearutop/sccdiff/releases/download/v1.0.1/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz
27+
curl -sLO https://github.com/vearutop/sccdiff/releases/download/v1.0.2/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && echo "b17e76bede22af0206b4918d3b3c4e7357f2a21b57f8de9e7c9dc0eb56b676c0 sccdiff" | shasum -c
2128
OUTPUT=$(cd pr && ../sccdiff -basedir ../base)
22-
OUTPUT="${OUTPUT//'%'/'%25'}"
23-
OUTPUT="${OUTPUT//$'\n'/'%0A'}"
24-
OUTPUT="${OUTPUT//$'\r'/'%0D'}"
29+
echo "${OUTPUT}"
30+
OUTPUT="${OUTPUT//$'\n'/%0A}"
2531
echo "::set-output name=diff::$OUTPUT"
2632
2733
- name: Comment Code Lines
34+
continue-on-error: true
2835
uses: marocchino/sticky-pull-request-comment@v2
2936
with:
3037
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3138
header: LOC
3239
message: |
3340
### Lines Of Code
3441
35-
${{ steps.loc.outputs.diff }}
42+
${{ steps.loc.outputs.diff }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import _ "github.com/bool64/dev" // Include development helpers to project.
2626
Add `Makefile` to your module with includes standard targets.
2727

2828
```Makefile
29-
#GOLANGCI_LINT_VERSION := "v1.45.2" # Optional configuration to pinpoint golangci-lint version.
29+
#GOLANGCI_LINT_VERSION := "v1.46.2" # Optional configuration to pinpoint golangci-lint version.
3030

3131
# The head of Makefile determines location of dev-go to include standard targets.
3232
GO ?= go

makefiles/base.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#GOLANGCI_LINT_VERSION := "v1.45.2" # Optional configuration to pinpoint golangci-lint version.
1+
#GOLANGCI_LINT_VERSION := "v1.46.2" # Optional configuration to pinpoint golangci-lint version.
22

33
# The head of Makefile determines location of dev-go to include standard targets.
44
GO ?= go

scripts/.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ linters:
3737
- tagliatelle
3838
- errname
3939
- ireturn
40+
- exhaustruct
41+
- nonamedreturns
4042

4143
issues:
4244
exclude-use-default: false

scripts/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
[ -z "$GO" ] && GO=go
4-
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.45.2"
4+
[ -z "$GOLANGCI_LINT_VERSION" ] && GOLANGCI_LINT_VERSION="v1.46.2"
55

66
# detecting GOPATH and removing trailing "/" if any
77
GOPATH="$(go env GOPATH)"

templates/github/workflows/cloc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Count Lines Of Code
2525
id: loc
2626
run: |
27-
curl -sLO https://github.com/vearutop/sccdiff/releases/download/v1.0.1/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz
27+
curl -sLO https://github.com/vearutop/sccdiff/releases/download/v1.0.2/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && echo "b17e76bede22af0206b4918d3b3c4e7357f2a21b57f8de9e7c9dc0eb56b676c0 sccdiff" | shasum -c
2828
OUTPUT=$(cd pr && ../sccdiff -basedir ../base)
2929
echo "${OUTPUT}"
3030
OUTPUT="${OUTPUT//$'\n'/%0A}"

templates/github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: golangci/[email protected]
2828
with:
2929
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
30-
version: v1.45.2
30+
version: v1.46.2
3131

3232
# Optional: working directory, useful for monorepos
3333
# working-directory: somedir

0 commit comments

Comments
 (0)