Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .custom-gcl.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v2.6.1
version: v2.7.0
plugins:
- module: "github.com/google/go-github/v79/tools/fmtpercentv"
path: ./tools/fmtpercentv
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ vendor/

# golangci-lint -v custom generates the following local file:
custom-gcl
custom-gcl.exe
4 changes: 2 additions & 2 deletions script/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e

GOLANGCI_LINT_VERSION="2.6.1"
GOLANGCI_LINT_VERSION="2.7.0"

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

MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)"
Expand Down
8 changes: 4 additions & 4 deletions tools/gen-release-notes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func splitIntoPRs(text string) []string {

func stripPRHTML(text string) string {
_, innerText := getTagSequence(text)
if i := strings.Index(text, "</a>"); i > 0 {
newText := text[:i] + strings.Join(innerText, "")
if before, _, ok := strings.Cut(text, "</a>"); ok {
newText := before + strings.Join(innerText, "")
Comment on lines +99 to +100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stringscut may report false positives: golang/go#76687

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looked correct to me, do you think it's wrong?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it breaks next time I use it, I'll revert the changes, so no big deal.

newText = strings.ReplaceAll(newText, "…", "")
newText = newlinesRE.ReplaceAllString(newText, "\n ")
return newText
Expand Down Expand Up @@ -138,8 +138,8 @@ func getTagSequence(text string) (tagSeq, innerText []string) {
tagSeq = append(tagSeq, s)
continue
}
if i := strings.Index(s, " "); i > 0 {
tagSeq = append(tagSeq, s[0:i])
if before, _, ok := strings.Cut(s, " "); ok {
tagSeq = append(tagSeq, before)
} else {
tagSeq = append(tagSeq, s)
}
Expand Down
Loading