swagger-api/swagger-codegen

[Python] Align with PEP8, PEP257

Open

#5 995 ouverte le 6 juil. 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)HTML (5 474 forks)batch import
Client: PythonEnhancement: Code formathelp wanted

Métriques du dépôt

Stars
 (12 701 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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: RESTClientObject and ApiClient) 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

#3041

Suggest a Fix

I can clean up the templates a bit and create a PR (I did quite a bit of it already)

Guide contributeur