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

proposal: x/tools/cmd/goimports: ability to exclude specific directory, like vendor #54706

Closed
bilalcaliskan opened this issue Aug 27, 2022 · 9 comments

Comments

@bilalcaliskan
Copy link

Currently as i know, goimports dont have an option to exclude specific directory so i am excluding vendor directory on my personal projects like below:

for item in $(find . -type f -name '*.go' -not -path './vendor/*'); do goimports -l -w $item; done

it is a little bit uggly i guess, so i and i think lots of gophers like me will be glad if that option is supported by goimports.

@gopherbot gopherbot added this to the Proposal milestone Aug 27, 2022
@bilalcaliskan bilalcaliskan changed the title proposal: tools/goimports: ability to exclude vendor directory proposal: tools/goimports: ability to exclude specific directory, like vendor Aug 27, 2022
@seankhliao seankhliao changed the title proposal: tools/goimports: ability to exclude specific directory, like vendor proposal: x/tools/cmd/goimports: ability to exclude specific directory, like vendor Aug 27, 2022
@ianlancetaylor
Copy link
Contributor

CC @golang/tools-team

@rsc
Copy link
Contributor

rsc commented Oct 12, 2022

This seems like a duplicate of #30058, #37724, and others. Is there a difference I am missing?

@rsc
Copy link
Contributor

rsc commented Oct 12, 2022

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc
Copy link
Contributor

rsc commented Oct 26, 2022

Based on the discussion above, this proposal seems like a likely decline.
— rsc for the proposal review group

@bilalcaliskan
Copy link
Author

@rsc why it is likely declined brother? what kind of negative consequences that tiny feature could have?

@ianlancetaylor
Copy link
Contributor

@bilalcaliskan See the issues mentioned above as duplicates.

@bilalcaliskan
Copy link
Author

I ve missed the duplicated issues so sorry for trouble. Closing that duplicate right now. Cheers!

@rsc
Copy link
Contributor

rsc commented Nov 2, 2022

This proposal has been declined as retracted.
— rsc for the proposal review group

@mauleyzaola
Copy link

I believe we need some way of ignoring .git directory or any workaround for this.

mau@mba-776:lucidgarage$ goimports -w .
.git/logs/refs/remotes/origin/feature/IOTTDO-2934-rename-dashboard.go-to-fhm_event_detection.go:1:63: expected ';', found 2
.git/logs/refs/remotes/origin/feature/IOTTDO-2934-rename-dashboard.go-to-fhm_event_detection.go:1:133: illegal character U+0040 '@'
.git/logs/refs/remotes/origin/feature/IOTTDO-2934-rename-dashboard.go-to-fhm_event_detection.go:2:2: expected '}', found 'EOF'
.git/refs/remotes/origin/feature/IOTTDO-2934-rename-dashboard.go-to-fhm_event_detection.go:1:23: expected ';', found cde7bb5fd5415b7f190e192b2c26ac2ffe6d883
.git/refs/remotes/origin/feature/IOTTDO-2934-rename-dashboard.go-to-fhm_event_detection.go:2:2: expected '}', found 'EOF'

@golang golang locked and limited conversation to collaborators Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants