Added the script that helps me fix dafny issues. #3038
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update: Added integration tests for this script
To see examples of the script workflow, please have a look at the tests
This file makes it possible to fix an error in Dafny in no time.
Add the following alias in your bash profile:
First usage
This script will automate for you and ask questions as appropriate.
Test/git-issues/git-issue-<issueNumber>.dfy
and
Test/git-issues/git-issue-<issueNumber>.dfy.expect
ensuring it contains a header that LIT can parse, considering the possibility that it needs to be run
Then, it opens these two files in their default editor.
DafnyLanguageServer.Text/Synchronization/DiagnosticsTest.cs
andcreates commented placeholders for the interaction and expected results.
fix-<issueNumber>-<issueKeyword>
, and commits the files there immediatelyFor an issue that already exists, then you enter the command
fix
alone,If you accept:
doc/dev/news/<issueNumber>.fix
file for you the first time, asking you about its content(including other
git-issue-<issueNumber><suffix>.dfy
files)to create the PR with the title and description already populated.
If you want to switch to another issue that you already initiated,
ensure the working directory is clean, and run
That will make the script to work:
If you are already in the issue branch and you want to re-open
the test files (because you closed them...), just write
If you want to do the publishing without running the tests, just write
If you want to add a new or existing test case for the same issue
(e.g. Test/git-issues/git-issue-b.dfy), run
If you just write
fix more
, you will be prompted for the argument.selected tests are run when you run
fix
without arguments.If more than one test is found, you'll be prompted to confirm your choices.