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

Code Formats, Nits & Unused Func/Var deletions #15286

Merged
merged 8 commits into from
Apr 9, 2021
Merged

Conversation

6543
Copy link
Member

@6543 6543 commented Apr 5, 2021

  • _ to unused func options
  • rm useless brakets
  • rm trifial non used models functions
  • rm dead code
  • rm dead global vars
  • fix routers/api/v1/repo/issue.go
  • dont overload import module

@6543 6543 added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 5, 2021
@6543 6543 added this to the 1.15.0 milestone Apr 5, 2021
if m == nil {
return nil
}

Copy link
Member

Choose a reason for hiding this comment

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

Why remove these?

Copy link
Member Author

Choose a reason for hiding this comment

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

because of dead code

see L100 & L110

If we like to keep it, we need a reason we should write down here ...

Copy link
Member Author

Choose a reason for hiding this comment

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

@lunny do we have a reason to keep it?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 5, 2021
@silverwind
Copy link
Member

Maybe some of these can be enforced by the linter.

@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 Apr 7, 2021
@@ -176,7 +175,7 @@ func SearchIssues(ctx *context.APIContext) {

// Only fetch the issues if we either don't have a keyword or the search returned issues
// This would otherwise return all issues if no issues were found by the search.
if len(keyword) == 0 || len(issueIDs) > 0 || len(labelIDs) > 0 {
if len(keyword) == 0 || len(issueIDs) > 0 || len(includedLabelNames) > 0 {
Copy link
Member

Choose a reason for hiding this comment

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

This maybe a bug but not a refactor?

Copy link
Member Author

Choose a reason for hiding this comment

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

didn't dig into it yet - posible

Copy link
Member Author

@6543 6543 Apr 9, 2021

Choose a reason for hiding this comment

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

look's like in an edge case the label filter potentially is not applied, but I could not hit it, so It's a code improvement to prevent becoming a bug in the future

@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 Apr 9, 2021
@6543
Copy link
Member Author

6543 commented Apr 9, 2021

🚀

@6543 6543 merged commit 9c4601b into go-gitea:master Apr 9, 2021
@6543 6543 deleted the nits branch April 9, 2021 07:40
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.

5 participants