Replies: 5 comments
-
Hmm, that's a hard one. Your point that automatically performing such big changes may be an interruption while development is understandable but heavily depends on the user workflow. Also most of the vfmt-related vet errors are to ensure |
Beta Was this translation helpful? Give feedback.
-
Go's vet doesn't have a I understand your point that it depends on the user workflow. This is the way I work with V too. However, for example, when I do web development I use VSCode and enable the "format on save" option, and I think that it's something pretty common, it cannot not be considered. Indeed, this checks can be kept for now then 🙂 |
Beta Was this translation helpful? Give feedback.
-
Maybe just keep things as they are now and instead just introduce a new flag |
Beta Was this translation helpful? Give feedback.
-
So your suggestions are already covered. |
Beta Was this translation helpful? Give feedback.
-
@JalonSolov oh, sorry for the fuss then and thanks for clarification! |
Beta Was this translation helpful? Give feedback.
-
Currently, vfmt does some automatic changes like
if 1 in [1]
=>if 1 == 1
- after some quick research, it looks like it is the only one at the time.I think this should be moved out of vfmt and added to a new vvet flag :
-fix
.Why ?
vfmt will eventually be expected to be run at each file save or so.
As proposed by @medvednikov on discord, vfmt could automatically change the signature of a function if it has too many parameters. Having it change the source code that much is really bothering during development.
On a typical workflow, I expected vvet to be run mainly before a commit, and I think this is the right time to fix this things, especially if it is done automatically.
Side-note
I personally think that errors that are automatically solved by using vfmt should not be checked in vvet:
(
Use(it is currently listed as a vfmt fix, but as written above, should be removed imo)var == value
instead ofvar in [value]
Beta Was this translation helpful? Give feedback.
All reactions