modules/structs should not/only-nessesary contain functions #4962

Closed
opened 2025-11-02 06:09:15 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @6543 on GitHub (Feb 27, 2020).

ToDo:

  • List of functions witch are afected
  • Check each func where it is used and if this make sence or if it need a refactor
  • remove functions
  • refactor what is there after remove ....

Functions witch exist in modules/structs package:

repo.go
185:func (gt GitServiceType) Name() string {

org_type.go
29:func (vt VisibleType) IsPublic() bool {
34:func (vt VisibleType) IsLimited() bool {
39:func (vt VisibleType) IsPrivate() bool {
44:func (vt VisibleType) String() string {
54:func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string) {

user.go
36:func (u User) MarshalJSON() ([]byte, error) {

commit_status.go
25:func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool {
41:func (css CommitStatusState) IsPending() bool {
46:func (css CommitStatusState) IsSuccess() bool {
51:func (css CommitStatusState) IsError() bool {
56:func (css CommitStatusState) IsFailure() bool {
61:func (css CommitStatusState) IsWarning() bool {

hook.go
135:func (p *CreatePayload) SetSecret(secret string) {
140:func (p *CreatePayload) JSONPayload() ([]byte, error) {
145:func ParseCreateHook(raw []byte) (*CreatePayload, error) {
190:func (p *DeletePayload) SetSecret(secret string) {
195:func (p *DeletePayload) JSONPayload() ([]byte, error) {
215:func (p *ForkPayload) SetSecret(secret string) {
220:func (p *ForkPayload) JSONPayload() ([]byte, error) {
247:func (p *IssueCommentPayload) SetSecret(secret string) {
252:func (p *IssueCommentPayload) JSONPayload() ([]byte, error) {
283:func (p *ReleasePayload) SetSecret(secret string) {
288:func (p *ReleasePayload) JSONPayload() ([]byte, error) {
314:func (p *PushPayload) SetSecret(secret string) {
319:func (p *PushPayload) JSONPayload() ([]byte, error) {
324:func ParsePushHook(raw []byte) (*PushPayload, error) {
340:func (p *PushPayload) Branch() string {
391:func (p *IssuePayload) SetSecret(secret string) {
396:func (p *IssuePayload) JSONPayload() ([]byte, error) {
432:func (p *PullRequestPayload) SetSecret(secret string) {
437:func (p *PullRequestPayload) JSONPayload() ([]byte, error) {
474:func (p *RepositoryPayload) SetSecret(secret string) {
479:func (p *RepositoryPayload) JSONPayload() ([]byte, error) {

task.go
16:func (taskType TaskType) Name() string {
Originally created by @6543 on GitHub (Feb 27, 2020). # ToDo: * [x] List of functions witch are afected * [ ] Check each func where it is used and if this make sence or if it need a refactor * [ ] remove functions * [ ] refactor what is there after remove .... Functions witch exist in `modules/structs` package: ```go repo.go 185:func (gt GitServiceType) Name() string { org_type.go 29:func (vt VisibleType) IsPublic() bool { 34:func (vt VisibleType) IsLimited() bool { 39:func (vt VisibleType) IsPrivate() bool { 44:func (vt VisibleType) String() string { 54:func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string) { user.go 36:func (u User) MarshalJSON() ([]byte, error) { commit_status.go 25:func (css CommitStatusState) NoBetterThan(css2 CommitStatusState) bool { 41:func (css CommitStatusState) IsPending() bool { 46:func (css CommitStatusState) IsSuccess() bool { 51:func (css CommitStatusState) IsError() bool { 56:func (css CommitStatusState) IsFailure() bool { 61:func (css CommitStatusState) IsWarning() bool { hook.go 135:func (p *CreatePayload) SetSecret(secret string) { 140:func (p *CreatePayload) JSONPayload() ([]byte, error) { 145:func ParseCreateHook(raw []byte) (*CreatePayload, error) { 190:func (p *DeletePayload) SetSecret(secret string) { 195:func (p *DeletePayload) JSONPayload() ([]byte, error) { 215:func (p *ForkPayload) SetSecret(secret string) { 220:func (p *ForkPayload) JSONPayload() ([]byte, error) { 247:func (p *IssueCommentPayload) SetSecret(secret string) { 252:func (p *IssueCommentPayload) JSONPayload() ([]byte, error) { 283:func (p *ReleasePayload) SetSecret(secret string) { 288:func (p *ReleasePayload) JSONPayload() ([]byte, error) { 314:func (p *PushPayload) SetSecret(secret string) { 319:func (p *PushPayload) JSONPayload() ([]byte, error) { 324:func ParsePushHook(raw []byte) (*PushPayload, error) { 340:func (p *PushPayload) Branch() string { 391:func (p *IssuePayload) SetSecret(secret string) { 396:func (p *IssuePayload) JSONPayload() ([]byte, error) { 432:func (p *PullRequestPayload) SetSecret(secret string) { 437:func (p *PullRequestPayload) JSONPayload() ([]byte, error) { 474:func (p *RepositoryPayload) SetSecret(secret string) { 479:func (p *RepositoryPayload) JSONPayload() ([]byte, error) { task.go 16:func (taskType TaskType) Name() string { ```
GiteaMirror added the type/proposaltype/refactoring labels 2025-11-02 06:09:15 -06:00
Author
Owner

@lunny commented on GitHub (Feb 29, 2020):

I think keep some properties functions is accepted.

@lunny commented on GitHub (Feb 29, 2020): I think keep some properties functions is accepted.
Author
Owner

@wxiaoguang commented on GitHub (Apr 15, 2025):

  • should not: unrealistic
  • should only-nessesary: I agree, it needs:
    1. define what is "necessary"
    2. spend enough time on improving designs, reviewing and rewriting contributor's PRs.

But for years I don't see progress for this problem.

@wxiaoguang commented on GitHub (Apr 15, 2025): * `should not`: unrealistic * `should only-nessesary`: I agree, it needs: 1. define what is "necessary" 2. spend enough time on improving designs, reviewing and rewriting contributor's PRs. But for years I don't see progress for this problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4962