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

Role issue #18093

Merged
merged 4 commits into from
Dec 26, 2021
Merged

Role issue #18093

merged 4 commits into from
Dec 26, 2021

Conversation

Gusted
Copy link
Contributor

@Gusted Gusted commented Dec 24, 2021

  • Avoid re-assignments xxx = xxx.WithRole(xxx).
  • Enable modifies-value-receiver rule(this was the only error)

- Avoid re-assignments `xxx = xxx.WithRole(xxx)`.
- Enable `modifies-value-receiver` rule(this was the only error)
@Gusted Gusted added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 24, 2021
@wxiaoguang
Copy link
Contributor

In Golang, c2 = WithContext(c1) means c1 is unchanged and returns a new c2.

So WithRole seems not following the naming style here. Perhaps we can think a new name for it.

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

lunny commented Dec 24, 2021

  • Avoid re-assignments xxx = xxx.WithRole(xxx).
  • Enable modifies-value-receiver rule(this was the only error)

I against this. Int is efficient enough. We don't need the pointer. No benefit from the refactor.

@wxiaoguang
Copy link
Contributor

Or could we just disable the lint for RoleDescriptor? The old code seems fine. :)

@Gusted
Copy link
Contributor Author

Gusted commented Dec 26, 2021

The old code seems fine. :)

The old code is fine indeed, after applying the suggestion from lunny(which is the actual correct fix for 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 Dec 26, 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 Dec 26, 2021
@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@4da2eab). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18093   +/-   ##
=======================================
  Coverage        ?   44.87%           
=======================================
  Files           ?      824           
  Lines           ?    91581           
  Branches        ?        0           
=======================================
  Hits            ?    41097           
  Misses          ?    43891           
  Partials        ?     6593           
Impacted Files Coverage Δ
models/issue_comment.go 52.40% <100.00%> (ø)

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 4da2eab...f5032cd. Read the comment docs.

@wxiaoguang wxiaoguang merged commit a2afd38 into go-gitea:main Dec 26, 2021
@Gusted Gusted deleted the role-issue branch January 2, 2022 22:50
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
@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
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.

None yet

5 participants