-
Notifications
You must be signed in to change notification settings - Fork 476
fix: apply 13 lint-monster correctness/style findings (2026-06-29) #42165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,7 +91,7 @@ func cleanOneOfMessage(message string) string { | |
| return message | ||
| } | ||
|
|
||
| schemaErrorsLog.Printf("Simplifying oneOf error message (%d lines)", len(strings.Split(message, "\n"))) | ||
| schemaErrorsLog.Printf("Simplifying oneOf error message (%d lines)", strings.Count(message, "\n")+1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/zoom-out] The allocation optimization is nullified by the very next statement. The PR description says this change avoids allocating a 💡 When this optimization would matterThis approach is a genuine win when the count is used in a conditional path that doesn't always reach the // Worth optimizing: count guards the Split
if strings.Count(message, "\n")+1 > threshold {
lines := strings.Split(message, "\n")
// ...
}Here, however, @copilot please address this. |
||
| lines := strings.Split(message, "\n") | ||
| var meaningful []string | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/zoom-out] Readability regression:
Promise.allwas collapsed to a single long line, contradicting the expansion applied toexecFileandhandlerin the same PR.The original multi-line form was clearer and consistent with this PR's other formatting improvements. The new single-line form is harder to scan at a glance.
💡 Suggested formatting
This mirrors the before-state and keeps each
readFilecall on its own line, which is easier to read and diff.@copilot please address this.