-
Notifications
You must be signed in to change notification settings - Fork 9
Create pre-commit hook #202
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| - id: byexample | ||
| name: run code snippets in docstrings to validate them | ||
| description: avoids writing errorneous code snippets. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it is correct that a failing example may mean an error in the code snippet, it is only one side of the coin. A failing example may mean that the snippet is correct but the source code that you are documenting is not. Perhaps a better description could be: I couldn't find where this information is shown or used by
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well I did not find much information about this neither. I mostly got inspiration from pre-commit’s pre-commit-hooks. |
||
| entry: byexample | ||
| language: python | ||
| require_serial: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could rephrase this as
"Run code snippets to validate them". I'm not 100% sure of my own proposal but I think that the word"docstring"suggests that it will only work for Python's docstrings which it's only one option.What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, you are correct. I am most familiar with Python’s docstrings and I did not think of the fact that not all languages put their docs into strings or use this term :)