Skip to content

slint-lsp format returns exit code 0 even on invalid input file #8229

Open
@ubruhin

Description

@ubruhin

Bug Description

I'm using slint-lsp format as a format checker on CI (make CI fail if sources are not formatted) which basically works, but I realized now that if the input is invalid (e.g. syntax errors) it does report the errors on stderr but it still exits with code 0. So it's not very useful as a format checker...

$ echo "foo" > test.slint

$ slint-lsp format test.slint
foo
error: Parse error: expected a top-level item such as a component, a struct, or a global
 --> test.slint:1:1
  |
1 | foo
  | ^

$ echo $?
0

Is that behavior intended for some reason, maybe for IDE integrations? Or would it be ok to make it returning nonzero on any kind of error? If the current behavior is important for some use-cases, a CLI flag could be introduced to change the exit code behavior...

Reproducible Code (if applicable)

Environment Details

  • Slint Version: 1.10.0
  • Platform/OS: Linux

Product Impact

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:lspslint-lsp and formating (mO,bT)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions