-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support -all flag for unconvert linter #1809
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
I still don't see a way how can we replace the fork with an upstream repo. The main repo does not provide the public methods, it cannot be used as a library. It will be great if you can modify the upstream repo to support |
Let's see if there is any interest in unconvert project: mdempsky/unconvert#52 If not I can update golangci-lint fork. |
Seems like there is no interest in the original repo. I will continue with a fork update. I fail to understand how can I modify the library to use I will update the fork and try to keep the current interface. With someone's help I might introduce Analyzer interface support. UPD: Hmm golangci uses Analyzer when calling unconvert. So the issue remains: how can I go through files for all platforms in unconvert lib? |
@zaynetro It would be great if you can introduce also More info: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Technically I think we will not be able to add the flag But I updated the fork inside PR #4473 and now you will be able to use I closed the issue based on my previous explanation. |
Is your feature request related to a problem? Please describe.
unconvert supports
-all
flag but there is no way you can use it through golang-ci.Describe the solution you'd like
It would be nice to run unconvert against multiple OSes.
Describe alternatives you've considered
Duplicate a method on Linux and FreeBSD build specific files.
Additional context
golang.org/x/sys/unix
exports Statfs_t struct which has aBavail
field. Unfortunately, on FreeBSD it isint64
compared touint64
on Linux.Sample code that compiles on both platforms but produces the lint error on Linux:
I have followed these steps until I got stuck:
pkg/config/config.go
test/testdata/unconvert.go
pkg/golinters/unconvert.go
The problem is that unconvert builds
loader.Program
dynamically for each OS and architecture but golangci-lint passes its ownloader.Program
. How do I build the Program for other configurations?On the other hand the up-to-date unconvert no longer uses
loader.Program
. Does it make sense to update the golangci-lint fork based on the latest changes?UPD: Looking at the latest unconvert it should be much easier to support -all flag.
The text was updated successfully, but these errors were encountered: