swagger-api / swagger-api/swagger-codegen
[Python] Align with PEP8, PEP257
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Since #3041 it seems the templates have drifted a bit from PEP8 guidelines. A couple examples that jumped at me:
- Some inconsistencies with acronym capitalization (ex:
RESTClientObjectandApiClient) ref - Lots of one-line docstrings taking up 3 lines ref
- Docstrings on property setters that are ignored by
help()and tools like Sphinx: example from Python docs
Not in PEP8, but there are a few instances where default values are set in __init__() using property setters before the underlying attribute is declared, which will throw an AttributeError if that initial assignment isn't made.
These are pretty low-key, but it'll help keep the linters quiet
Swagger-codegen version
2.2.0 and 2.3.0
Related issues
Suggest a Fix
I can clean up the templates a bit and create a PR (I did quite a bit of it already)
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
Inspect the Python client templates and the generated Python code, using the examples in the issue as the initial checklist. Align naming, one-line docstrings, property documentation, and init attribute ordering with PEP8 and PEP257, then verify that the resulting templates keep linters quiet.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100