Document how to test plugins
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 356
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing plugin-development/formatters documentation and the flake8 2.x-to-3.x migration context described in the issue. Document a worked example covering valid function or class entrypoints, testing a string against one check, and running standard checks without a subprocess. Done means the example answers all three questions and is suitable for a documentation PR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100