Linting - all code to pass flak8, pep8

As requested by Meredydd, raising here

we like to ensure that all our committed code is linted with pep8, flake8 etc, these tools throw a right wobbly when they hit code generated in the exported servers we use on our mini arm servers. Could your code be made compliant with these standards?

3 Likes

I agree, I would love for the Anvil editor to become just like PyCharm.

But in this case the workaround is very simple (I do it with 100% of my apps): clone the app, open it with PyCharm, press Ctrl+L and check the Problems tab.

Another alternative, which I use a lot and have shown elsewhere on here, is to to use the firenvim browser extension which will replace any textbox in your browser with an instance of neovim running locally on your machine. You then get whatever tools you’ve configured in your neovim.

That’s discussed in

And I have a quick video showing how it can be used with copilot in

1 Like

Specifically, we want generated code in a downloaded setup pass linting so it does not offend out ci/cd pipelines, we run anvil apps on embedded arm platforms…

Whenever I create a new form or module in the ide, the first thing I do is to remove all auto generated code.

Because, amongst other things,

  • I don’t like starred imports
  • I don’t want irrelevant comments

So, yes, I very much agree with this request. I was just adding my own current workaround rather than disagreeing!

There is a time and place for auto-generated code. But it’s often best for us to define and use our own standards, when we do. See Cog | Ned Batchelder for an interesting tool along this line…