Git Product home page Git Product logo

Comments (6)

sbdchd avatar sbdchd commented on July 28, 2024

I think it would be best to make PHP_CodeSniffer use the generally accepted Posix exit codes: http://tldp.org/LDP/abs/html/exitcodes.html

However, I would be open to adding an option for formatters that decide to go rogue with their exit codes.

from neoformat.

esamattis avatar esamattis commented on July 28, 2024

I totally agree with you. I opened issue on PHP_CodeSniffer squizlabs/PHP_CodeSniffer#1359

from neoformat.

esamattis avatar esamattis commented on July 28, 2024

They are not interested in fixing it.

How about adding an optional callback function which validates the exit codes?

from neoformat.

sbdchd avatar sbdchd commented on July 28, 2024

An optional callback could be created, but it will require some work since Neoformat currently uses v:shell_error after calling system() to check if the command error.

Here is the relevant doc:

v:shell_error Result of the last shell command. When non-zero, the last
shell command had an error. When zero, there was no problem.
This only works when the shell returns the error code to Vim.
The value -1 is often used when the command could not be
executed. Read-only.
Example:

:!mv foo bar
:if v:shell_error
:  echo 'could not rename "foo" to "bar"!'
:endif

from neoformat.

esamattis avatar esamattis commented on July 28, 2024

The v:shell_error does seem to contain the command exit code

:call system("exit 4")
:echo v:shell_error
4

so it should not be too much work.

from neoformat.

sbdchd avatar sbdchd commented on July 28, 2024

See new config variables:

https://github.com/sbdchd/neoformat#config-optional

from neoformat.

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.