Skip to content

Conversation

@jameslamb
Copy link
Collaborator

This PR proposes replacing uses of exit -1 in shell scripts with exit 1.

Benefits of this change

Removes reliance on shells correctly handling exit -1 (which is technically not recommended by e.g. bash) in the project's scripts.

Notes for Reviewers

From the bash docs (link)

Exit statuses fall between 0 and 255

And from the shellcheck docs (SC2242)

Note in particular that exit -1 is equivalent to exit 255, but that exit 1 is the more canonical way of expressing the first possible error code.

This change resolves the following error from shellcheck:

SC2242 (error): Can only exit with status 0-255. Other data should be written to stdout/stderr.

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants