Comments (6)
In the situation you describe, what do you imagine would result in a non-zero exit status?
I don't think adding a flag is necessary, but exiting with a different status code might achieve what you want?
from gometalinter.
I am not intimately familiar with the code base so I can't give the most precise suggestions. However, I could envision a few cases where it would still exit with a non-zero exit code:
- Cannot write to stdout
- One of the linters failed to run or the command did not exist
- Specifying an invalid command line invocation (passing a flag that does not exist etc)
- Linters timing out
There are probably more. I would prefer a flag over having two different exit codes because in Go it is quite painful to get at the actual code. It is also OS-specific so it makes it harder to write portable programs if you have to distinguish between e.g. exit code 1 and 2. It can be done and is still preferable to no solution, but I would personally prefer the flag. Up to you though :)
from gometalinter.
Hey, any thoughts on this?
from gometalinter.
I think I understand what you're trying to achieve now. Currently, timeouts, missing linters, linter failures, etc. are logged but do not result in a non-zero exit status. You'd like to know that all the linters are running correctly to completion.
This seems reasonable to me.
I'd be happy with a flag like --strict
that causes gometalinter to exit with a status code > 1 if any of the above issues occur. I don't like the idea of exiting with a zero status for linter failures, as this directly goes against expected behaviour. And for all practical platforms, an exit code shouldn't be an issue.
from gometalinter.
It turns out that this was more difficult than anticipated, but the new code removes the reliance on cmd/sh which is also a good thing.
from gometalinter.
Great, thank you for this! The solution you implemented will work nicely for me. And yes, it seems that getting the exit status is more portable than before (I believe windows did not implement syscall.WaitStatus before), so that will be fine. Thanks again!
from gometalinter.
Related Issues (20)
- Add goreturns HOT 2
- go get failing due to kingping HOT 2
- The order of CLI flags aren't respected in combination with the config HOT 1
- Error when installing metalinter with vim-go HOT 2
- Adding support for power(ppc64le) arch HOT 9
- gometalinter does not invoke golint correctly HOT 1
- How to set the cyclomatic complexity value when using gometalinter? HOT 1
- Not reporting results from linters to VSCode HOT 4
- Remove supports for megacheck, unused, gosimple
- install.sh not working under Windows HOT 1
- The return value of calling gometalinterwith shell is not 0 HOT 5
- Add impi HOT 1
- gometalinter 3.0.0 is still looking for gosimple HOT 3
- Install failing on go 1.6.1 HOT 1
- vendor not work in go 1.10+ HOT 5
- Archive gometalinter HOT 22
- go mod vendor error HOT 4
- unknown linters: gosec
- Unmatched checksum HOT 4
- gometalinter doesn't work with golang 1.12.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gometalinter.