From dab763656a76eac85fc913f108055df03bcfdca4 Mon Sep 17 00:00:00 2001 From: Ben Fulton Date: Thu, 20 Aug 2026 10:07:30 +0100 Subject: [PATCH 1/2] Update precommit checker versions Also update driven_cavity example in accordance with checks --- .pre-commit-config.yaml | 10 +++++----- examples/driven_cavity/driven_cavity.py | 12 ++++++------ examples/driven_cavity/generate_mesh | 2 +- examples/driven_cavity/plot_data | 6 ++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd0018d779..9b19ef50ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ exclude: configure|\.*.msh|\.*.rng|^h5hut/\.*|^libjudy\.*|^libmba2d\.*|^libmba3d\.*|^libspud\.*|^spatialindex-1.8.0\.* repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: check-ast - id: check-builtin-literals @@ -19,12 +19,12 @@ repos: - id: mixed-line-ending exclude: ref_vtk_hexahedra.vtu - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 23.3.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.5.1 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 9.0.0b5 hooks: - id: isort args: ["--profile", "black", "--filter-files"] @@ -33,7 +33,7 @@ repos: hooks: - id: pyupgrade - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.3.0 hooks: - id: flake8 args: ["--max-line-length", "88", "--extend-ignore", "E203,E722"] diff --git a/examples/driven_cavity/driven_cavity.py b/examples/driven_cavity/driven_cavity.py index 288d87a075..0ac4e5e7c2 100644 --- a/examples/driven_cavity/driven_cavity.py +++ b/examples/driven_cavity/driven_cavity.py @@ -160,7 +160,7 @@ def erturk_u(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape norm = 0.0 for i in range(ilen): diff = pts[i][3] - velocity[i][0] @@ -217,7 +217,7 @@ def erturk_v(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape norm = 0.0 for i in range(ilen): diff = pts[i][3] - velocity[i][1] @@ -269,7 +269,7 @@ def botella_u(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape norm = 0.0 for i in range(ilen): diff = pts[i][3] - velocity[i][0] @@ -320,7 +320,7 @@ def botella_v(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape norm = 0.0 for i in range(ilen): @@ -372,7 +372,7 @@ def botella_p1(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape pressure = u.ProbeData(pts, "Pressure") pts0 = np.array( @@ -430,7 +430,7 @@ def botella_p2(NN): ) velocity = u.ProbeData(pts, "Velocity") - (ilen, jlen) = velocity.shape + ilen, jlen = velocity.shape pressure = u.ProbeData(pts, "Pressure") pts0 = np.array( diff --git a/examples/driven_cavity/generate_mesh b/examples/driven_cavity/generate_mesh index 75bb3f77ef..83b13b9e94 100755 --- a/examples/driven_cavity/generate_mesh +++ b/examples/driven_cavity/generate_mesh @@ -12,7 +12,7 @@ optparser = OptionParser( description="""Generate the mesh files for a given resolution.""", ) -(options, argv) = optparser.parse_args() +options, argv = optparser.parse_args() try: NN = int(argv[0]) diff --git a/examples/driven_cavity/plot_data b/examples/driven_cavity/plot_data index ad5b8f12df..133fc74d11 100755 --- a/examples/driven_cavity/plot_data +++ b/examples/driven_cavity/plot_data @@ -7,11 +7,9 @@ import pylab def usage(): - print( - """plot_data + print("""plot_data - is a space-separated list of the inverse mesh spacing.""" - ) + is a space-separated list of the inverse mesh spacing.""") try: From 8d565cecf17f1c176d2ddbc7ad775b7e7eb6d6b7 Mon Sep 17 00:00:00 2001 From: Ben Fulton Date: Fri, 21 Aug 2026 09:04:12 +0100 Subject: [PATCH 2/2] Don't autocommit pre-commit hooks --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b19ef50ed..f341c9043b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,8 @@ # exclude auto generated files like configure, *.msh and *.rng files # and any files from external libraries: h5hut/libjudy/libmba[23]d/libspud and spatialindex exclude: configure|\.*.msh|\.*.rng|^h5hut/\.*|^libjudy\.*|^libmba2d\.*|^libmba3d\.*|^libspud\.*|^spatialindex-1.8.0\.* +ci: + autofix_prs: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0