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

Initial implementation of check docstrings from python #1712

Merged
merged 7 commits into from
Aug 6, 2024

Conversation

glguy
Copy link
Member

@glguy glguy commented Jul 25, 2024

Check-point: docstrings can be checked from python

At a minimum work remains to update the documentation strings for this feature.

@glguy glguy self-assigned this Jul 25, 2024
@weaversa
Copy link
Collaborator

Do you envision the timeout being for the entire check, or a timeout for each individual check in scope? If you're undecided, let me suggest the timeout should apply to each individual check. By this I mean that if a module has 10 checks, and we run check_docstrings with a timeout of 1 second, each check that takes less than 1 second should succeed, and the rest fail, but all checks should be attempted.

@glguy
Copy link
Member Author

glguy commented Jul 25, 2024

Do you envision the timeout being for the entire check, or a timeout for each individual check in scope? If you're undecided, let me suggest the timeout should apply to each individual check. By this I mean that if a module has 10 checks, and we run check_docstrings with a timeout of 1 second, each check that takes less than 1 second should succeed, and the rest fail, but all checks should be attempted.

Your idea makes sense. I'll take a look. I need to see how timeouts would interact with external solvers and their state but it seems like something we should be able to account for.

@WeeknightMVP
Copy link

Do you envision the timeout being for the entire check, or a timeout for each individual check in scope? If you're undecided, let me suggest the timeout should apply to each individual check. By this I mean that if a module has 10 checks, and we run check_docstrings with a timeout of 1 second, each check that takes less than 1 second should succeed, and the rest fail, but all checks should be attempted.

Because different verification commands take different times for different configurations, automated testing and other use cases for :check-docstrings would benefit from configuring a timeout for a given verification command or group thereof. This could be specified as a (not currently supported) REPL configuration setting...

module TimeoutExample where

import Primitive::Symmetric::Cipher::Block::DES (DES)

/**
 * DES correctly recovers plaintext encrypted with the same shared key.
 * 
 * ```
 * :set timeout=5.0  // takes about 2.0s in my workspace
 * :set prover=abc
 * :prove DESCorrect
 * ```
 */
property DESCorrect key msg = DES.decrypt key (DES.encrypt key msg) == msg

...or perhaps stored in a database of verification results and adapted based on completion time.

@glguy glguy force-pushed the glguy/checkdocstrings-from-remoteapi branch from dab7a1c to 4b143d2 Compare August 2, 2024 22:22
@glguy glguy marked this pull request as ready for review August 6, 2024 01:17
@glguy glguy merged commit df4c9df into master Aug 6, 2024
48 checks passed
@glguy glguy deleted the glguy/checkdocstrings-from-remoteapi branch August 6, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants