-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add no-llm tests into pre-commit hook
- Loading branch information
1 parent
8918857
commit fb72bed
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
# from: https://jaredkhan.com/blog/mypy-pre-commit | ||
|
||
# A script for running mypy, | ||
# with all its dependencies installed. | ||
|
||
set -o errexit | ||
|
||
# Change directory to the project root directory. | ||
cd "$(dirname "$0")"/.. | ||
|
||
# Install the dependencies into the mypy env. | ||
# Note that this can take seconds to run. | ||
# In my case, I need to use a custom index URL. | ||
# Avoid pip spending time quietly retrying since | ||
# likely cause of failure is lack of VPN connection. | ||
pip install --editable ".[dev]" \ | ||
--retries 1 \ | ||
--no-input \ | ||
--quiet | ||
|
||
# Run on all files, | ||
# ignoring the paths passed to this script, | ||
# so as not to miss type errors. | ||
# My repo makes use of namespace packages. | ||
# Use the namespace-packages flag | ||
# and specify the package to run on explicitly. | ||
# Note that we do not use --ignore-missing-imports, | ||
# as this can give us false confidence in our results. | ||
# mypy fastagency | ||
./scripts/test-no-llm.sh |