Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

enforce nolint scope#34851

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
silverwind merged 16 commits intogo-gitea:mainfromTheFox0x7:nolintlint-flags
Jun 27, 2025
Merged

Conversation

@TheFox0x7
Copy link
Contributor

enable nolintlint scope requirement
add comments to new directives so it's more obvious why they are in place


I can also toggle the mandatory comments on if that's something of interest.

silverwind reacted with thumbs up emoji
@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelJun 24, 2025
@github-actionsgithub-actionsbot added modifies/apiThis PR adds API routes or modifies them modifies/goPull requests that update Go code modifies/migrations modifies/internal labelsJun 24, 2025
@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsJun 24, 2025
Copy link
Member

@silverwindsilverwind left a comment
edited
Loading

Choose a reason for hiding this comment

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

Nice work. Resolve comments above before merge.

@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsJun 25, 2025
funcTestCleanUploadFileName(t*testing.T) {
assert.Empty(t,CleanGitTreePath(""))
assert.Empty(t,CleanGitTreePath("."))
assert.Equal(t,"",CleanGitTreePath(""))//nolint:testifylint // for readability and alignment
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, adding comments make it harder to read ...

I can help to rewrite the code to something like

for testCase := range cases {    assert.Equal(....)}

(if you don't mind)

Then we can get rid of the "nolint" tricks

silverwind reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Go ahead, the maintainer edit thing is checked :)

Copy link
Member

@silverwindsilverwindJun 25, 2025
edited
Loading

Choose a reason for hiding this comment

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

Yes, eliminating nolints is better. I think something ought to be done about the migration packages too. Maybe just a config in.golangci.yml that disables revive for those files, but it's a pretty broad disable.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Those are fixable with a rename. I don't suppose that's breaking as migrations are internal and I'd be surprised if something in our code relied on package name. It's more of an issue of what name should there be.
There's also not much benefit in that and the_ rule could be suppressed globally (to coveroauth_* as well) or for migrations only.
See text based rules which I think would work for this

Copy link
Member

@silverwindsilverwindJun 25, 2025
edited
Loading

Choose a reason for hiding this comment

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

Which specificrevive rule is being triggered by these underscores? Maybe we can disable the rule itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

So why do you think we can't disablevar-naming exactly?

See:But we can't fully disable it, because it also check other places like ID in models

There are too many unclear parts.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what the ID topic is about, but then let's go with theskip-package-name-checks option?

Copy link
Contributor

@wxiaoguangwxiaoguangJun 26, 2025
edited
Loading

Choose a reason for hiding this comment

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

but then let's go with theskip-package-name-checks option?

Agree

Copy link
ContributorAuthor

@TheFox0x7TheFox0x7Jun 26, 2025
edited
Loading

Choose a reason for hiding this comment

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

Done. Added comments in80b05b7 to document why those 3 rules are in place.
I'll probably follow this PR up with a comment enforcement - I think the reason for disabling the rule will be very useful long term.


follow up is ready - no clue how to stack stuff here so I'll wait for this to land.

Copy link
Member

@silverwindsilverwindJun 27, 2025
edited
Loading

Choose a reason for hiding this comment

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

You could go onto this branch andgit cherry-pick <hash> the commit hash(es) from the other branch, but let's do the merge then.

@wxiaoguang
Copy link
Contributor

Made some changes:

  • rewrite TestCleanUploadFileName, no "nolint" now
  • shorten some comments since we have used "nolint" then "it shouldn't be an issue"
    • "underscore in migration packages isn't a large issue" -> "version underscore"
    • " export stutter, not a large issue" -> " export stutter"
TheFox0x7 reacted with thumbs up emoji

@silverwindsilverwind marked this pull request as draftJune 25, 2025 12:08
@TheFox0x7TheFox0x7 marked this pull request as ready for reviewJune 25, 2025 21:12
@TheFox0x7TheFox0x7 marked this pull request as draftJune 25, 2025 21:42
@silverwindsilverwind self-requested a reviewJune 26, 2025 05:21
@TheFox0x7TheFox0x7 marked this pull request as ready for reviewJune 26, 2025 15:32
@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJun 26, 2025
@lunnylunny removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJun 26, 2025
@silverwindsilverwind merged commiteb36a45 intogo-gitea:mainJun 27, 2025
26 checks passed
@GiteaBotGiteaBot added this to the1.25.0 milestoneJun 27, 2025
@TheFox0x7TheFox0x7 deleted the nolintlint-flags branchJune 27, 2025 07:36
wxiaoguang added a commit that referenced this pull requestJun 27, 2025
Follows up#34851---------Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull requestJun 30, 2025
* giteaofficial/main:  Add a `login`/`login-name`/`username` disambiguation to affected endpoint parameters and response/request models (go-gitea#34901)  Improve tags list page (go-gitea#34898)  [skip ci] Updated translations via Crowdin  docs: fix typo in pull request merge warning message text (go-gitea#34899)  Refactor container package (go-gitea#34877)  [skip ci] Updated translations via Crowdin  Fix project column edit (go-gitea#34890)  Upgrade htmx to 2.0.6 (go-gitea#34887)  Optimize flex layout of release attachment area (go-gitea#34885)  Improve `labels-list` rendering (go-gitea#34846)  enforce explanation for necessary nolints and fix bugs (go-gitea#34883)  Fix a regression when refactoring fork list (go-gitea#34879)  enforce nolint scope (go-gitea#34851)
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsSep 25, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@wxiaoguangwxiaoguangwxiaoguang approved these changes

@delvhdelvhdelvh approved these changes

@silverwindsilverwindAwaiting requested review from silverwind

Assignees

No one assigned

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go codemodifies/internalmodifies/migrations

Projects

None yet

Milestone

1.25.0

Development

Successfully merging this pull request may close these issues.

6 participants

@TheFox0x7@wxiaoguang@silverwind@delvh@lunny@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp