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

fix: add local imported packages to the packages to analyze when using cache#4424

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

Open
ldez wants to merge2 commits intogolangci:master
base:master
Choose a base branch
Loading
fromldez:fix/cache-imports

Conversation

@ldez
Copy link
Member

@ldezldez commentedFeb 27, 2024
edited
Loading

To reproduce the problem:

git clone git@github.com:gabolaev/gl-issue-reproduction.git&&cd$_golangci-lint cache cleangit checkout HEAD.; golangci-lint run; sed -i's/some text/SOME OTHER TEXT/g' somepackage/somefile.go; golangci-lint run# git checkout HEAD .; ./golangci-lint run; sed -i 's/some text/SOME OTHER TEXT/g' somepackage/somefile.go; ./golangci-lint run

If it works you should see:

somepackage/somefile.go:9:2: printf: (*github.com/sirupsen/logrus.Logger).Warnf format %v reads arg #1, but call has 0 args (govet)        log.Warnf("some text %v") // this line is supposed to be reported by govet printf linter        ^somepackage/somefile.go:9:2: printf: (*github.com/sirupsen/logrus.Logger).Warnf format %v reads arg #1, but call has 0 args (govet)        log.Warnf("SOME OTHER TEXT %v") // this line is supposed to be reported by govet printf linter        ^

but if it not works:

somepackage/somefile.go:9:2: printf: (*github.com/sirupsen/logrus.Logger).Warnf format %v reads arg #1, but call has 0 args (govet)        log.Warnf("some text %v") // this line is supposed to be reported by govet printf linter        ^

This will impact negatively the performance of a run with a cache but it will increase the stability of reports.

Fixes#4423

gabolaev reacted with thumbs up emoji
@ldezldez added bugSomething isn't working area: cache labelsFeb 27, 2024
@ldezldezforce-pushed thefix/cache-imports branch 2 times, most recently from849f21e toccf27b4CompareFebruary 27, 2024 21:29
Copy link
Member

@bombsimonbombsimon left a comment

Choose a reason for hiding this comment

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

Did you do any tests (manual or otherwise) on a somewhat larger codebase and/or with a lot of local imports? Are we talking millisecond increases or can this become a cardinality bomb and grow much bigger than that?

The fix looks good and is understandable so I'll approve this since I have full trust in your judgement here 😄

ldez reacted with heart emoji
@ldez
Copy link
MemberAuthor

ldez commentedFeb 28, 2024
edited
Loading

Did you do any tests (manual or otherwise) on a somewhat larger codebase and/or with a lot of local imports?

I didn't do a benchmark because this depends on how many direct packages a package depends on, so it's difficult to create accurate benchmarks.

Are we talking millisecond increases or can this become a cardinality bomb and grow much bigger than that?

As it just adds the direct packages related to one analyzed package and not the indirect packages, the cardinality is limited.

But if a package depends on thousands of local packages (I hope nobody does that), the impact will be important on performances (only for the run after the first one) but I don't have a better solution.

EDIT: I have some doubts maybe the real problem is the linter 🤔

Copy link

@gabolaevgabolaev left a comment

Choose a reason for hiding this comment

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

It works, thank you!

@ldezldez removed the request for review fromAntonboomMarch 1, 2024 12:43
@ldezldez added the blockedNeed's direct action from maintainer labelMar 1, 2024
@alexandearalexandear self-requested a reviewMarch 9, 2024 16:02
Copy link
Member

@alexandearalexandear left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexandearalexandearalexandear approved these changes

@bombsimonbombsimonbombsimon approved these changes

+1 more reviewer

@gabolaevgabolaevgabolaev approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

area: cacheblockedNeed's direct action from maintainerbugSomething isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

govet:printf unstable behavior with imported types

4 participants

@ldez@alexandear@bombsimon@gabolaev

[8]ページ先頭

©2009-2025 Movatter.jp