Skip to content

Fix deluge of linter complaints on branch merge#646

Merged
Shaptic merged 8 commits intoprotocol-nextfrom
ci-fixes
Mar 30, 2026
Merged

Fix deluge of linter complaints on branch merge#646
Shaptic merged 8 commits intoprotocol-nextfrom
ci-fixes

Conversation

@Shaptic
Copy link
Copy Markdown
Contributor

@Shaptic Shaptic commented Mar 30, 2026

What

Appease CI.

Why

The branch-merge in #623 is complaining with 6 or 7 thousand linter complaints so I asked copilot to fix them.

Known limitations

n/a

@Shaptic Shaptic changed the title Linter fixups O_o Fix deluge of linter complaints on branch merge Mar 30, 2026
// we had one or more missing options, combine these all into a single error.
errString := "The following required configuration parameters are missing:"
var errBuilder strings.Builder
errBuilder.WriteString("The following required configuration parameters are missing:")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Linter caught these string building thingies?
:respect:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"caught" is a stretch for short strings, but yes 😆

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have a ton of linting failures on the codebase in theory, but the CI only runs on touched files so we can update them piecemeal. This is a common one

if batchEnd > len(insertableEvents) {
batchEnd = len(insertableEvents)
}
batchEnd := min(batchStart+maxEventsPerBatch, len(insertableEvents))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Linter caught this too?

Copy link
Copy Markdown
Contributor Author

@Shaptic Shaptic Mar 30, 2026

Choose a reason for hiding this comment

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

This is all from piping the golangci-lint job logs to gpt via copilot, and this complaint specifically came from the modernize linter, yes.

Comment thread cmd/stellar-rpc/main.go Outdated
os.Exit(1)
}
fmt.Println(string(out))
_, _ = fmt.Fprintln(os.Stdout, string(out))
Copy link
Copy Markdown
Contributor

@karthikiyer56 karthikiyer56 Mar 30, 2026

Choose a reason for hiding this comment

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

Is this needed?
There is no requirement that you are supposed to take the return values and do anything with it.
This just looks weird.
If the linter really is complaining about these kinda things then perhaps we need to do update linter settings somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's from https://github.com/kisielk/errcheck, i.e. error if errors aren't check. I agree that it's a little aggressive, lemme see if there are settings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can add it to the ignorelist for the checker, but I think a one-off is better here. We may want to ensure writes match buffers in other cases 🤷

@Shaptic Shaptic merged commit 4963a29 into protocol-next Mar 30, 2026
15 checks passed
@Shaptic Shaptic deleted the ci-fixes branch March 30, 2026 22:34
Shaptic added a commit that referenced this pull request Mar 31, 2026
* Bump soroban-env to next protocol version (#595)
 - Add required config key to mocked ledger entries
 - Integrate unstable-next-api into curr (dropped arg)

* Update XDR and Core runs to test P26 integration (#629)
 - Bump Golang to 1.25 and linter to be compatible
 - Bumped Go SDK to latest @protocol-next
 - Added P26 limits from quickstart and removed P24 limits

* Fix deluge of linter complaints on branch merge (#646)

---------

Co-authored-by: Siddharth Suresh <siddharth@stellar.org>
karthikiyer56 added a commit that referenced this pull request Apr 9, 2026
* Bump soroban-env to next protocol version (#595)

* Bump soroban-env to next protocol version
* Add required config key to mocked ledger entries
* Integrate unstable-next-api into curr (dropped arg)

* Bump soroban-env SHA to latest (#611)

* Update XDR and Core runs to test P26 integration (#629)

* Split the single core_version input into core_deb_version and core_docker_img to accommodate differences.
* Bump Core versions for P25 and add P26 run
* Bump Golang to 1.25 and linter to be compatible
* Bumped soroban-env-host curr to latest commit SHA in repo
* Bumped Go SDK to latest @protocol-next
* Added P26 limits from quickstart and removed P24 limits

* Bump crate dependencies to latest Protocol 26 versions (#640)

* Remove unimplemented GitHub Action (#643)

Snuck in with a `git add -A` on accident

* Bump Core to Protocol 26 release candidate (#642)

* Bump Core to p26 release candidate
* Bump Go SDK version to latest
* Bump to official patched env

* Ensure we strip NUL bytes before `CString::new` (#632)

* Fix deluge of linter complaints on branch merge (#646)

* Release v26.0.0 (#647)

* Tag off changelog for major release
* Bump Go SDK to official P26 version
* Bump CI to latest stable core for a final run

* Add GHA to automatically update soroban-env on protocol-next (#645)

* Preserve version string in Cargo.toml on automatic dependency bump (#672)

* Preserve version= in Cargo.toml on bump
* Simplify code: use a function, better names

* Bump to soroban-env to latest version (#673)

---------

Co-authored-by: George <Shaptic@users.noreply.github.com>
Co-authored-by: Siddharth Suresh <siddharth@stellar.org>
Co-authored-by: George <george@stellar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants