misc,python: Add pyupgrade hook to pre-commit

This hook automatically upgrades the syntax to recommended standards for
new versions of the language.

These are numerous and are outlined here:
https://github.com/asottile/pyupgrade

Change-Id: I73fc58a08160ed9a21cfa3b3e023c259a84592ba
This commit is contained in:
Bobby R. Bruce
2023-10-09 13:30:27 -07:00
parent 3f5d7d647a
commit 83af4525ce

View File

@@ -72,6 +72,13 @@ repos:
rev: 23.9.1 rev: 23.9.1
hooks: hooks:
- id: black - id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.14.0
hooks:
- id: pyupgrade
# Python 3.8 is the earliest version supported.
# We therefore conform to the standards compatible with 3.8+.
args: [--py38-plus]
- repo: local - repo: local
hooks: hooks:
- id: gem5-style-checker - id: gem5-style-checker