Skip to content
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

--check [FILE] returns 0 exit code for invalid syntax #451

Open
reese opened this issue Dec 14, 2023 · 0 comments
Open

--check [FILE] returns 0 exit code for invalid syntax #451

reese opened this issue Dec 14, 2023 · 0 comments

Comments

@reese
Copy link
Collaborator

reese commented Dec 14, 2023

  • Rubyfmt git sha: e00d2ab89fd4b0b85a7897fac393c1ad987136de (0.10.0)

Input file + Rubyfmt's output

$ cat hi.rb
bad syntax in here

$ cat hi.rb | cargo run -- --check
Rubyfmt detected a syntax error in the ruby code being executed

$ echo $?
1

$ cargo run -- --check hi.rb 
Rubyfmt detected a syntax error in the ruby code being executed

$ echo $?
0

This breaks because

These two are inconsistent (despite having the same input), and realistically it should probably return 5 in both cases (since we return 5 for invalid syntax in normal runs).

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

No branches or pull requests

1 participant