Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the error message when a file hasn't been type checked #643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/checkTypeChecked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ echo "Checking that all Agda files have been typechecked..."
for agdaFn in $(find . -name '*.*agda'); do
agdaiFn="_build/2.7.0/agda/${agdaFn%.*agda}.agdai"
if [ "$(( $(stat -c "%Y" $agdaiFn) - $(stat -c "%Y" $agdaFn) ))" -lt "0" ]; then
echo " FAIL: $agdaiFn is not up-to-date"
echo " FAIL: $agdaiFn does not exist. Please remove the corresponding agda file or import it somewhere."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the impression that if the script doesn't find an agdai file then it exits and then the corresponding agda file will be type-checked, so the agdai file will be there on the next pass. If that's true, then this error message isn't really what we want. If that's wrong, then I'm fine with the change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to double check, but I think the first pass of this script is probably pointless and can be removed. If it does something we should add a flag to this script to give the old error message on the first run and the new one on the second run. IIRC the first run of this script only prevents a call to agda if all the interface files are there, but then that call would be very quick anyway (and this would only ever happen locally anyway).

exit 1
fi
done
echo " PASS: all Agda files have been typechecked"
echo " PASS: all Agda files have been typechecked."
Loading