From 0fd107e6c76835087524d49c216a38985ffffa38 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 23 Apr 2024 12:23:13 +0100 Subject: [PATCH] pre-commit: Add pyupgrade hook Another day, another useful hook. We also ignore the preceding patch that actually did the work, renaming the incorrect named file in the process. Change-Id: I412827761fbdeb36702ebaf5c1b727c62e629299 Signed-off-by: Stephen Finucane --- .git-ignore-blame-revs => .git-blame-ignore-revs | 1 + .pre-commit-config.yaml | 5 +++++ 2 files changed, 6 insertions(+) rename .git-ignore-blame-revs => .git-blame-ignore-revs (89%) diff --git a/.git-ignore-blame-revs b/.git-blame-ignore-revs similarity index 89% rename from .git-ignore-blame-revs rename to .git-blame-ignore-revs index 625df1357c..62caf9485a 100644 --- a/.git-ignore-blame-revs +++ b/.git-blame-ignore-revs @@ -1,6 +1,7 @@ # You can configure git to automatically use this file with the following config: # git config --global blame.ignoreRevsFile .git-blame-ignore-revs +c5b772db76c071e493a81105c7d8c0def08b2264 # trivial: Prepare for pyupgrade pre-commit hook ed0314ac76ae58a6621077feb742efd5c14c3a62 # Blacken everything else ac64fdb93c32972575a4523ccb23d0279ef584f5 # Blacken openstackclient.api a3778109d0051a25901569e7bafe54915ab25f82 # Blacken openstack.common diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c384867d1..6154c51ea0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,11 @@ repos: - id: check-yaml files: .*\.(yaml|yml)$ args: ['--unsafe'] + - repo: https://github.com/asottile/pyupgrade + rev: v3.15.2 + hooks: + - id: pyupgrade + args: ['--py38-plus'] - repo: https://github.com/psf/black rev: 24.4.0 hooks: