Skip to content

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

@reese

Description

@reese
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions