realpython / realpython/python-guide
Recommended autoformatters?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Batchfile
- Sterne
- 29.8k
- Forks
- 5.9k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
In the Code Style document https://github.com/realpython/python-guide/blob/master/docs/writing/style.rst there's a small mention of autopep8 which can be used to format code to meet PEP8 standards. But there's at least two other autoformatters (black and yapf) which are as good if not better. There's a blog comparing the three here: https://medium.com/3yourmind/auto-formatters-for-python-8925065f9505
The gist of it is: autopep8 is the most conservative, black is the most opinionated, and yapf is somewhere in between depending on how you configure it.
Should the python guide have an opinion on which auto formatters should be used? In addition to the current mention of autopep8. I think it would be good to expand this section; auto formatters are quite useful and of great interest to developers coming from tools like gofmt and prettier.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in docs/writing/style.rst bei der bestehenden Erwähnung von autopep8 und prüfe anschließend den verlinkten Vergleich von autopep8, black und yapf. Aktualisiere das Code-Style-Dokument mit Hinweisen zu diesen Formatierern und einer klaren Empfehlung oder einem Vergleich; der Abschnitt sollte erklären, wie Entwickler einen Autoformatter auswählen können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100