Skip to content

Commit 841abae

Browse files
authored
chore: Update golangci-lint to v2.7.0 (#3853)
1 parent e279f70 commit 841abae

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v2.6.1
1+
version: v2.7.0
22
plugins:
33
- module: "github.com/google/go-github/v79/tools/fmtpercentv"
44
path: ./tools/fmtpercentv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ vendor/
1818

1919
# golangci-lint -v custom generates the following local file:
2020
custom-gcl
21+
custom-gcl.exe

script/lint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
GOLANGCI_LINT_VERSION="2.6.1"
8+
GOLANGCI_LINT_VERSION="2.7.0"
99

1010
CDPATH="" cd -- "$(dirname -- "$0")/.."
1111
BIN="$(pwd -P)"/bin
@@ -22,7 +22,7 @@ fail() {
2222
# install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version
2323
if ! "$BIN"/custom-gcl --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then
2424
GOBIN="$BIN" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION"
25-
"$BIN"/golangci-lint custom && mv ./custom-gcl "$BIN"
25+
"$BIN"/golangci-lint custom --name custom-gcl --destination "$BIN"
2626
fi
2727

2828
MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)"

tools/gen-release-notes/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ func splitIntoPRs(text string) []string {
9696

9797
func stripPRHTML(text string) string {
9898
_, innerText := getTagSequence(text)
99-
if i := strings.Index(text, "</a>"); i > 0 {
100-
newText := text[:i] + strings.Join(innerText, "")
99+
if before, _, ok := strings.Cut(text, "</a>"); ok {
100+
newText := before + strings.Join(innerText, "")
101101
newText = strings.ReplaceAll(newText, "…", "")
102102
newText = newlinesRE.ReplaceAllString(newText, "\n ")
103103
return newText
@@ -138,8 +138,8 @@ func getTagSequence(text string) (tagSeq, innerText []string) {
138138
tagSeq = append(tagSeq, s)
139139
continue
140140
}
141-
if i := strings.Index(s, " "); i > 0 {
142-
tagSeq = append(tagSeq, s[0:i])
141+
if before, _, ok := strings.Cut(s, " "); ok {
142+
tagSeq = append(tagSeq, before)
143143
} else {
144144
tagSeq = append(tagSeq, s)
145145
}

0 commit comments

Comments
 (0)