resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Contract violation when given a non-installed package

Open usaoc opened this issue 2 years ago • 1 comments

The --package option uses pkg-directory, which returns #f when no such package is installed. In turn, this triggers a contract violation from simple-form-path. For example,

$ resyntax analyze --package no-such-package
simple-form-path: contract violation
  expected: path-string?
  given: #f
  context...:
    ....

usaoc avatar Aug 30 '23 12:08 usaoc

Hmm. Yeah that's not ideal. There's two options:

  1. Make --package install the package when it's not already installed
  2. Make --package error with a much better error message when the package isn't installed.

I lean heavily towards 2, on the basis that I don't think resyntax should change the state of your installation (beyond resyntax fix making the changes it suggests).

jackfirth avatar Aug 31 '23 06:08 jackfirth