Skip to content
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

Remove unnecassary calls to filepath.Join #17608

Merged
merged 4 commits into from
Nov 15, 2021
Merged

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Nov 10, 2021

  • Partialy resolvess Tracking issue: Updating golangci-lint #17596
  • Resolves badCall errors from go-critic badCall: suspicious Join on 1 argument
  • When only 1 argument is passed into filepath.Join, it won't do anything special other than filepath.Clean(...) will be applied over it.

All but 1 filepath.Join() with 1 argument was completely removed, as they those arguments were already coming from functions or variables that already did filepath.Join() with multiple arguments, thus completely useless to pass it again into filepath.Join().

- Partialy resolvess go-gitea#17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 10, 2021
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Nov 11, 2021
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 14, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 15, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #17608 (73f3298) into main (83a04e4) will decrease coverage by 0.00%.
The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17608      +/-   ##
==========================================
- Coverage   45.48%   45.48%   -0.01%     
==========================================
  Files         799      799              
  Lines       88961    88961              
==========================================
- Hits        40462    40461       -1     
+ Misses      42002    42001       -1     
- Partials     6497     6499       +2     
Impacted Files Coverage Δ
modules/repository/adopt.go 0.00% <0.00%> (ø)
routers/web/user/setting/adopt.go 0.00% <0.00%> (ø)
routers/web/user/setting/profile.go 38.22% <0.00%> (ø)
services/pull/merge.go 49.87% <100.00%> (ø)
modules/notification/mail/mail.go 35.29% <0.00%> (-2.95%) ⬇️
modules/log/event.go 60.64% <0.00%> (-1.86%) ⬇️
modules/notification/ui/ui.go 60.86% <0.00%> (-1.45%) ⬇️
models/notification.go 64.71% <0.00%> (-0.87%) ⬇️
models/issue_comment.go 52.48% <0.00%> (ø)
modules/queue/queue_bytefifo.go 59.88% <0.00%> (+0.59%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10db864...73f3298. Read the comment docs.

@6543 6543 added this to the 1.16.0 milestone Nov 15, 2021
@lunny
Copy link
Member

lunny commented Nov 15, 2021

make L-G-T-M work.

@lunny lunny merged commit 253d9e4 into go-gitea:main Nov 15, 2021
zeripath pushed a commit that referenced this pull request Nov 16, 2021
Backport #17598 
Backport #17606 
Backport #17608 
Backport #17609

- Since https://gitea.com/gitea/test-env/pulls/10 the golangci-lint has been upgraded and is erroring about new warnings in the code, this PR fixes those warnings.
@Gusted Gusted deleted the fix-badCalls branch November 16, 2021 20:41
@zeripath zeripath added the backport/done All backports for this PR have been created label Dec 25, 2021
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
- Partialy resolvess go-gitea#17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: 6543 <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants