Skip to content

Set proper exit code when cpplint.py detects lint errors. #20

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Set proper exit code when cpplint.py detects lint errors. #20

wants to merge 1 commit into from

Conversation

agirorn
Copy link

@agirorn agirorn commented Feb 22, 2017

This will allow users to run node-cpplint in shell scripts and not force
them to use grunt-cpplint when that is not necessary.

node-cpplint src/** || echo "The C++ lint failed with exit code $?"

I was unable to get the tests to work for this because I do not know how to stub process.on and reset the process.exitCode in vowsjs testing framework.

This will allow users to run node-cpplint in shell scripts and not force
them to use grunt-cpplint when that is not necessary.

node-cpplint src/** || echo "The C++ lint failed with exit code $?"
});
/*jslint unparam:false*/
});
}

process.on('exit', function () {
process.exit(process.exitCode);
Copy link

@MiniGod MiniGod Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do this. Setting process.exitCode above is enough.

https://nodejs.org/docs/latest/api/process.html#process_process_exitcode

process.exitCode
A number which will be the process exit code, when the process [...] exits gracefully

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On node.js 0.10 this is required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agirorn I suggest that your remove this now as node.js 0.10 is long out of support, The we should look at getting this landed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants