diff options
Diffstat (limited to 'Omni/Ide/typecheck.sh')
| -rwxr-xr-x | Omni/Ide/typecheck.sh | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/Omni/Ide/typecheck.sh b/Omni/Ide/typecheck.sh index 5f92c90..0d9648d 100755 --- a/Omni/Ide/typecheck.sh +++ b/Omni/Ide/typecheck.sh @@ -4,8 +4,8 @@ ### ### > typecheck.sh <target..> ### -### Runs the typechecker for the given target by building it with bild. -### This leverages bild's built-in typechecking without running tests. +### Uses repl.sh to provision the environment for target, then runs the +### appropriate typechecker for the given module. ### help() { sed -rn 's/^### ?//;T;p' "$0" @@ -16,6 +16,24 @@ if [[ $# == 0 ]] || [[ "$1" == "-h" ]]; then fi target="$1" -# Use bild to typecheck (bild runs mypy for Python, ghc for Haskell, etc.) -# This is simpler than trying to set up the environment ourselves -bild "$target" +# Determine file extension +ext="${target##*.}" + +case "$ext" in + py) + # Python: use mypy via repl.sh environment + repl.sh --cmd "python -m mypy $target" "$target" + ;; + hs) + # Haskell: use ghc -fno-code + # This would need the right environment from repl.sh + echo "Haskell typechecking not yet implemented in typecheck.sh" + echo "Use 'bild $target' to build and typecheck" + exit 1 + ;; + *) + echo "Unknown file extension: $ext" + echo "Typechecking not supported for this file type" + exit 1 + ;; +esac |
