Giter VIP home page Giter VIP logo

Comments (6)

alecthomas avatar alecthomas commented on July 16, 2024

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.

eandre avatar eandre commented on July 16, 2024

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.

eandre avatar eandre commented on July 16, 2024

Hey, any thoughts on this?

from gometalinter.

alecthomas avatar alecthomas commented on July 16, 2024

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.

alecthomas avatar alecthomas commented on July 16, 2024

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.

eandre avatar eandre commented on July 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.