Description
In GitLab by @stephenfin on May 23, 2019, 03:07
I'm trying to migrate hacking from flake8 2.x to 3.x and finding it extremely difficult to do so because the internals of the flake8 have changed so drastically between these versions (plus hacking does some stuff that's too smart for its own good, IMO). The flake8 documentation provides some introductory text on plugins, including a guide on writing a "formatting type" plugin (though it doesn't explain what a formatting plugin actually is...) but there's nothing about testing this or even what type of class or function the entrypoints should point to. The biggest issue I have is that I want to run flake8 in it entirety (i.e. with both the standard checks and my plugin enabled) on a test string, but there doesn't appear to be anyway to do this.
Would it be possible to get a small worked example that demonstrates:
- What the entrypoint should look like (i.e. if it can be a Python function, a class, or both)
- How you can test a string against only a single check
- How you can test a string against flake8's standard checks (without having to resort to a subprocess call)
I'll happily submit a documentation PR based on this example, if it would be helpful.