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

[43] Fix go vet hags on first run #47

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Conversation

hiddenmarten
Copy link
Member

No description provided.

@hiddenmarten hiddenmarten linked an issue Mar 19, 2024 that may be closed by this pull request
@hiddenmarten hiddenmarten enabled auto-merge (squash) March 19, 2024 22:14
@sircthulhu
Copy link
Member

@hiddenmarten
Could you please explain why this change will fix this error?

@hiddenmarten
Copy link
Member Author

@sircthulhu @sergeyshevch

By default, pre-commit operates using multiple threads in parallel. However, this flag alters its behavior to use only one thread. I've tested this adjustment on my local setup and it helps.

Copy link
Collaborator

@AlexGluck AlexGluck left a comment

Choose a reason for hiding this comment

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

I think we need change behavior instead of broke parallel work of linters (this worsens performance).

@hiddenmarten
Copy link
Member Author

Probably I gave you an incorrect explanation about the behavior of pre-commit.
I meant processes, not threads.

By default, pre-commit runs a bunch of processes

make-vet.................................................................Passed
- hook id: make-vet
- duration: 0.95s

go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...
go vet ./...

however, with this option pre-commit runs go vet ./... only once, which means parallelization (as well as performance) of the linter itself isn't affected:

make-vet.................................................................Passed
- hook id: make-vet
- duration: 0.33s

go vet ./...

The root issue is about concurrent go get . calls triggered by go vet ./....

@hiddenmarten hiddenmarten dismissed AlexGluck’s stale review March 21, 2024 17:24

Explained issue widely.

Copy link
Collaborator

@AlexGluck AlexGluck left a comment

Choose a reason for hiding this comment

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

lgtm

@hiddenmarten hiddenmarten merged commit 48bd4fc into main Mar 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-commit works incorrectly if modules not installed
4 participants