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

[BUG] Cells which start with %%html lead to SyntaxError #177

Open
Dobatymo opened this issue Nov 26, 2021 · 3 comments
Open

[BUG] Cells which start with %%html lead to SyntaxError #177

Dobatymo opened this issue Nov 26, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Dobatymo
Copy link

Dobatymo commented Nov 26, 2021

Describe the bug
%%html at the start of a cell can be used to output raw html. flake8-nb fails with E999 SyntaxError: invalid syntax.

To Reproduce
Have a cell like

%%html
<a href="#">asd</a>

in the notebook and run flake8-nb

Expected behavior
These cells should be ignored like other non-code cells.

Desktop (please complete the following information):

  • OS: Windows 10 x64
  • Version: Python 3.8.10 with flake8-nb==0.3.1
@Dobatymo Dobatymo added the bug Something isn't working label Nov 26, 2021
@s-weigand
Copy link
Owner

Thanks for reporting this bug!
For the time being, you can use the cell tag flake8-noqa-cell.

But I agree that cells with cell magic, which isn't ExecutionMagics line %%timeit or explicitly defines the code as python code (%%python) should be dropped by default.

@s-weigand
Copy link
Owner

@all-contributors please add @Dobatymo for bug

@allcontributors
Copy link
Contributor

@s-weigand

I've put up a pull request to add @Dobatymo! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants