PEP8 and editor options

If I clone an anvil app to my local machine and do anything within my local editor, I have PEP8 complaints from my linter which are distracting and annoying. (It particularly doesn’t like the use of two spaces instead of four).

Given that it’s almost impossible to find a way to please everyone in this area, could I suggest the use of http://editorconfig.org/?

If the ide supported editorconfig, there could be a default config file for any app which could then be ammended to suit individual needs.

5 Likes

Any thoughts on this one? The two space indentation is doing my head in!

2 Likes

Most gentle of nudges…

Old thread, but I agree. 4 spaces is the right way to go for Python. Should be a project level setting. 4 spaces default for new apps, 2 spaces for existing apps. A tool to help convert space count would be a nice touch.

2 Likes

raymond hettinger on 2 space indents…

1 Like

+1 for enabling 4-space indents, please!

1 Like

This tab size is now customisable in your profile :slight_smile:

2 Likes

Yep, that and the dark theme made me very happy!

1 Like

Bonus - if you’re switching between 2/4 space indents you can do ctrl/cmd + I to re-indent your code to your preferred tab size.

4 Likes