apache / apache/cloudstack

Add pre-commit hook `pyupgrade` to auto upgrade Python syntax

Offen
#10,977 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
long-term-plan
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.4k
Ø Merge
6 T. 19 Std.
Gemergte PRs (30 T.)
32

Beschreibung

"A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language."

https://github.com/asottile/pyupgrade

https://github.com/asottile/pyupgrade?tab=readme-ov-file#python2-and-old-python3x-blocks

Example `.pre-commit-config.yaml` entry:

```
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus]
```

Availability:

- --py36-plus will remove Python <= 3.5 only blocks
- --py37-plus will remove Python <= 3.6 only blocks
so on and so forth

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Untersuche die vorhandene .pre-commit-config.yaml des Repositorys und ermittle die vom Projekt verwendete Python-Versionsrichtlinie. Füge den pyupgrade-Hook mit dem passenden --py37-plus-style-Argument aus dem Issue hinzu und überprüfe anschließend, dass die Pre-Commit-Konfiguration es akzeptiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.