-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix the errors #4
Comments
I'll try to fix this this week but I have to dig into how golangci-lint want this data so I can implement it there at the same time. |
This would be very useful! I generally like the whitespace suggestions but it's a lot of effort to fix them manually and an automatic "fixup" mode would be great! |
@stmuk Yeah I totally agree! I've just scratched the surface on how I'll try to find the time to look into this and I think it would be a lot more useful for people out there if the tool was bundled with a way to apply the suggestions. |
I finally got the time to have a look at this and the obvious way forward seems to be to use analysis with I've created a the branch I must say I feel a bit lost looking into this but I've made some progress. The major part of adding a newline before a cuddled command is done but I must figure out a way to format the file properly. The most important part would be to remove the tabs used as indentation and add them back again. Not really sure how I would do this but I guess I'll take what's between the previous statement + potential comments and the faulty statement. So the far:
I'm trying to run this code on bigger projects and it seems like not all errors are found and also that the numbers of errors varies. for _ in {1..10}; do wsl-analyze ./... 2>&1 | wc -l; done
350
325
19
276
17
348
77
328
134
234 After running with the |
Could you convert this to a tracking pull request?:) |
@LennyPenny Sorry but I'm not familiar with what that means? Should I just create a working PR towards master or does it mean something else? |
It seems like my naive approach of passing all analasys.Pass Files to one function was stupid so instead I now create a new processor for each file (which is a subset of the AST) and that seems to be consistent. Output from the same project as above. $ for _ in {1..10}; do wsl-analyzer ./... 2>&1 | wc -l; done
1087
1087
1087
1087
1087
1087
1087
1087
1087
1087 So now the next step would be to figure out a proper way to handle comments. Since the analasys package already parsed the AST there's not much I can do, however I recently found dave/dst which handles comments much much better. So given that I can convert the AST to DST I guess this might actually not be so difficult. So sorry for this issue not being resolved but I hope I can get the time and motivation to actually finish this fixer which I guess would help people a lot. PS. Any input and help is very much welcome! |
It almost took 5 years but I guess this just shows that we should never stop hoping. Sorry for the delay and the solution is currently not compatible with I'll draft a release soon that can be used to install |
Support to create a fixed version like
go fmt
to resolve the reported issues.The text was updated successfully, but these errors were encountered: