Skip to content

refactor: drop redundant filepath.Clean around filepath.Join#3279

Merged
wen-coding merged 2 commits intomainfrom
claude/hungry-carson-3b75db
Apr 22, 2026
Merged

refactor: drop redundant filepath.Clean around filepath.Join#3279
wen-coding merged 2 commits intomainfrom
claude/hungry-carson-3b75db

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

Summary

  • filepath.Join already calls filepath.Clean on its result, so wrapping the join with an extra filepath.Clean is a no-op.
  • Addresses post-merge review feedback on #3220.
  • Touches only the three files introduced/modified by that PR: sei-tendermint/privval/file.go, sei-tendermint/types/node_key.go, and sei-tendermint/cmd/tendermint/commands/gen_autobahn_config.go.

Test plan

  • gofmt -s -l clean on changed files
  • go vet ./privval/... ./types/... ./cmd/tendermint/commands/... passes
  • CI green

🤖 Generated with Claude Code

filepath.Join already invokes filepath.Clean on its result, so wrapping
it again is a no-op. Addresses post-merge review feedback on #3220.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 20, 2026, 11:28 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.35%. Comparing base (2900e9a) to head (7c0821f).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...int/cmd/tendermint/commands/gen_autobahn_config.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3279   +/-   ##
=======================================
  Coverage   59.35%   59.35%           
=======================================
  Files        2072     2072           
  Lines      169922   169922           
=======================================
+ Hits       100855   100857    +2     
+ Misses      60279    60278    -1     
+ Partials     8788     8787    -1     
Flag Coverage Δ
sei-chain-pr 75.88% <40.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/privval/file.go 68.00% <100.00%> (ø)
sei-tendermint/types/node_key.go 67.44% <100.00%> (ø)
...int/cmd/tendermint/commands/gen_autobahn_config.go 18.18% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

gosec G304 ("potential file inclusion via variable") fires whenever
os.ReadFile is called with a non-literal argument and only quiets down
when it sees an explicit filepath.Clean wrap. But filepath.Join already
calls Clean on its result (per path/filepath docs), and Clean itself
does not prevent traversal — filepath.Clean("../../etc/passwd") returns
"../../etc/passwd" unchanged. The wrap was appeasing the heuristic, not
adding a security boundary.

This is a CLI command (tendermint gen-autobahn-config) where dir comes
from positional args supplied by the operator running the binary. There
is no untrusted-input path, so G304 is a false positive. Annotate with
//nolint:gosec instead of re-introducing redundant Clean calls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

LGTM

@wen-coding wen-coding requested a review from pompon0 April 21, 2026 21:19
@wen-coding wen-coding added this pull request to the merge queue Apr 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@wen-coding wen-coding added this pull request to the merge queue Apr 22, 2026
Merged via the queue into main with commit 97cdec8 Apr 22, 2026
39 checks passed
@wen-coding wen-coding deleted the claude/hungry-carson-3b75db branch April 22, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants