WhatsApp / eqwalizer

A type-checker for Erlang
Apache License 2.0
506 stars 27 forks source link

ELP should return error code in case of project issues #40

Closed egobrain closed 12 months ago

egobrain commented 12 months ago

Hello, is there a way to make elp return a non-zero code if errors are found ? This will allow elp to be easily integrated with ci-tools.

$  elp eqwalize-all
  Loading rebar3 build_info
  Loading applications      ████████████████████ 17/17
  Seeding database
  Compiling dependencies
  eqWAlized                 ████████████████████ 24/24                                                                                                                                                                                                         error: expected_subtype
   ┌─ src/client/oidc_client.erl:69:13
   │
69 │             {error, unavailable};
   │             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   │             │
   │             {'error', 'unavailable'}.
Expected: {'ok', oidc:claims()} | {'error', oidc:token_info_error()}
Got     : {'error', 'unavailable'}

   │

  {'error', 'unavailable'} is not a subtype of {'ok', oidc:claims()} | {'error', oidc:token_info_error()}
  because
  at tuple index 1:
  {'error', 'unavailable'} is not a subtype of {'ok', oidc:claims()}
  because
  'error' is not a subtype of 'ok'

$ echo $?
0
egobrain commented 12 months ago

@ilya-klyuchnikov awesome. Is there any release eta for binary elp with this feature?

ilya-klyuchnikov commented 12 months ago

Is there any release eta for binary elp with this feature?

this week

ilya-klyuchnikov commented 12 months ago

the release is out: https://github.com/WhatsApp/eqwalizer/releases/tag/v0.20.31