jackfirth / resyntax

A Racket refactoring engine
Apache License 2.0
51 stars 10 forks source link

Contract violation when given a non-installed package #212

Open usaoc opened 12 months ago

usaoc commented 12 months ago

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...:
    ....
jackfirth commented 12 months ago

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).