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
Is there a way to lint doctest compatible code examples. #1
Comments
@proofit404 You're welcome! That's an interesting idea. It would be possible to add an additional regex rule to lint a
I'd just have to strip the first 4 characters off each line. That sounds like a fun feature to add. About the subprocess: I was just looking today at flake8-rst, which I did realize existed when I started working on this. I'll see what I can learn from that project. |
Add support for linting python/REPL code blocks, like: ```pycon >>> banana = "banana" >>> for character in banana: ... print(characterr) ``` Closes #1
@proofit404 I've got a working version of this feature. Given this file,
I want to clean up the code some more and add more tests before I publish this. You can try this feature in the After this feature release, I'm going to turn this into a proper Flake8 plugin. Thanks again for the suggestions! |
Good job! Thanks for the time you have invested in it. |
@proofit404 Thanks, thanks! I should be able to get this published this evening. One quirk that I'll mention in the README is that the code examples should end with a newline. Flake8 complains about the "file" not ending with a newline, and |
Add support for linting pycon code blocks, like: ```pycon >>> banana = "banana" >>> for character in banana: ... print(characterr) ``` - Include license file in build - Bump version to v0.2.0 Closes #1
Add support for linting pycon code blocks, like: ```pycon >>> banana = "banana" >>> for character in banana: ... print(characterr) ``` - Include license file in build - Bump version to v0.2.0 Closes #1
Add support for linting pycon code blocks, like: ```pycon >>> banana = "banana" >>> for character in banana: ... print(characterr) ``` - Include license file in build - Bump version to v0.2.0 Closes #1
🎉 🍰 🎉 |
Hi, thank you for the meaningful package!
I prefer to write my code examples to be compatible with python doctest module.
It would be great if we will be able to lint this code :)
P.S. Is there a chance you will start to use complete markdown parser and run flake8 through API and not subprocesses?
I understand this approach works right now, but in future, it will case support troubles.
Regards, Artem.
The text was updated successfully, but these errors were encountered: