Flake8 was installed lately by one of the updates of vscode. I think it is time to comply to the “rules” of python to writer better and more readable code. Unfortunately I have some errors that I cannot fix in the code (no discussion about that, but a local module has to be loaded before some others). I want to
Tag: flake8
How to use flake8 as unittest case?
I want to make flake8 a unittest case for all my source files. The unittest have to fail when the code is not PEP8 conform. I still do this with pycodestyle that way. But I don’t know how to do this with flake8 after import flake8. Answer As others have pointed out, this is not something you should be doing
Refactoring Test Logic in Pytest to Avoid Complex Raises Block
I’m using the flake8-pytest-style plugin and it flags a certain test as violating PT012. This is about having too much logic in the raises() statement. The code in question is this: Basically this is testing the following code: What I do is just pass in a version of Python that is less than the required and make sure the error
Filter out specific errors from Flake8 results
We are writing notebooks in databricks. When we put them to git we want to run flake8 on them to check for new problems in the code. As databricks has some predefined variables those are undefined in the code itself. Is it possible to filter our errors like: While keeping errors like I am aware of the –ignore parameter, but