-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Strange docs in "Known Limitations" #386
Comments
It should be |
I'm a fan of your blog btw (which I found thanks to an interview you gave, I think with podcast.init), honored to find you here |
@MarcoGorelli oh, wow! Thanks a lot for your kind words and this project 😊 I invite you to contribute! wemake-services/wemake-python-styleguide#1704 |
Nice! So the idea would be to use this to adapt your current highly opinionated style-guide to Jupyter Notebooks? If so, yeah, I'd be happy to contribute / work on this together!
Thanks! Is it OK if I include this as a testimonial in the readme and link to your blog? |
Yes, exaclty! The problem I trying to solve right now is that a lot of people use Python in Jupyter as their main env. But, that's where your project shines! It allows to use not just I would also love to hear users' insights about what rules are not applicable to Jupyter. Because I suspect there's some specific. Any help is appreciated!
I would be honoured! 🙇♂️ |
I'd like to think that if you have
would work (though there are almost certainly many more extra error codes we would need to ignore). We would also need to get #377 merged so we catch cases when code is hidden inside magic commands, e.g. we wouldn't want
to return "pandas as pd imported but unused". But that PR should cover such cases. In terms of implementation - if we added tests specifically for |
I am not sure. Do you have an experience with similar tests? Which one works best? |
Yes - the way nbqa works is that it converts the notebooks you pass it to temporary Python files (with some adjustments for magics, such as
which aren't valid Python), runs the code quality tool on them, and then parses the output. Optionally (though this wouldn't be the case for For the tools we "officially" support (black, flake8, mypy, pyupgrade, isort, doctest, pylint) we have tests checking that the output looks the way it's meant to. As Simply, instead of
you would run
It would be useful if you could try running that on some notebooks to see if the output is what you would expect (and report back if it isn't) - barring the aforementioned cases of inline magics where you might get some false-positives, my expectation is that this should work the way you expect it to |
Nevermind, I just tried this on a notebook and got
So, we have some work to do with parsing the output from the extra plugins before we can claim to support |
@all-contributors please add @sobolevn for ideas, bugs, doc |
I've put up a pull request to add @sobolevn! 🎉 |
@sobolevn Until @MarcoGorelli sorry for promoting my own tool here 😞 |
@s-weigand no need to apologise - this is open source, we all share the benefits of each others' work 😄 If anything, thanks for all your amazing contributions here! I was going to try flake8-nb with WPS out to see if it worked, looks like you beat me to it 😄 For completeness, flake8-nb also has the limitation which we're trying to get around: Untitled.ipynb:
command-line:
But still, I think such cases are rare and so it's probably a good way of running WPS for >99% of cases |
The latest release (0.3.6) solves this problem, which was due to WPS giving warnings about line 0 (which I hadn't planned for 😳) There's still some work to do before the in-line magics limitation is solved, but...we're getting there 🚀 |
Hi!
I was reading your docs and then I found this:
The text says "after trailing comma", but the examples are using trailing
;
Which one is correct?
The text was updated successfully, but these errors were encountered: