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

Use "# %%" instead of "#%%" as default cell delimiter (or allow customization) #2991

Closed
memeplex opened this issue Sep 29, 2019 · 6 comments
Closed
Assignees

Comments

@memeplex
Copy link

By default the extension inserts #%% after executing the last cell in a file. This is also the documented cell delimiter. But it's not compliant with flake8 and other popular python linters, which expect at least one whitespace after the #. In general, it's not possible to configure these linters to ignore a specific pattern, but just to disable predefined rules. I understand that exploratory work often violates conventions and produces "write-only" code. But I believe that changing the default delimiter to # %% is a simple change that will keep flake8 from flooding the problems view. You could maybe offer the option to change this default delimiter, given that you already offer the option to change the delimiter regex (which by default is also compatible with # %%)..

@rchiodo
Copy link
Contributor

rchiodo commented Sep 30, 2019

Thanks. Seems like an easy change that shouldn't really affect anything negatively.

@memeplex
Copy link
Author

memeplex commented Sep 30, 2019

Do you think it would be desirable to add a customization option? I don't think it's really that useful but OTOH it seems weird to me having a customizable regex to match an uncustomizable marker. Maybe this option should be removed instead of the other one added?

@rchiodo
Copy link
Contributor

rchiodo commented Sep 30, 2019

The marker is customizable, just not the one that we output at the end. We should probably have the setting too then, otherwise in the case where somebody is actually customizing the regex for matching, shift+enter won't work correctly.

We'll check telemetry first though to see how many people have changed the regex.

@memeplex
Copy link
Author

We'll check telemetry first though to see how many people have changed the regex.

For all the hate that telemetry gets, it's great that you can do that kind of "data-driven development".

@rchiodo rchiodo self-assigned this Oct 4, 2019
@janosh
Copy link
Contributor

janosh commented Oct 23, 2019

I think microsoft/vscode-python#7782 is the right move. 👍

@memeplex Just for the record though, at least for flake8, this is configurable via setup.cfg.

[flake8]
# E265: block comment should start with '# '
ignore = E265

@IanMatthewHuff IanMatthewHuff self-assigned this Oct 28, 2019
@IanMatthewHuff
Copy link
Member

Validated.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants