From f43f4ae1b1d0e17b9d6b8d28b7c45f0f539b9110 Mon Sep 17 00:00:00 2001 From: Dunedan Date: Sun, 17 Aug 2025 15:17:13 +0200 Subject: [PATCH] Update the pre-commit hooks With v3.12.0 shfmt changed the behavior of the `--simplify` option to ignore any EditorConfig when it's provided. Therefore, this option is now moved to the EditorConfig as suggested by the shfmt author. See https://github.com/mvdan/sh/issues/1173 for details. --- .editorconfig | 1 + .pre-commit-config.yaml | 11 +++++------ source/tools/entity/checkrefs.py | 2 +- source/tools/spirv/compile.py | 4 ++-- source/tools/templatesanalyzer/unit_tables.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2ef5c541af..dafe99cecd 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,6 +19,7 @@ indent_style = space [*.sh] indent_style = tab function_next_line = true +simplify = true switch_case_indent = true [*.{yaml,yml}] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e37c006f8..b320bf2103 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: @@ -34,7 +34,7 @@ repos: \.patch$ ) - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.11 + rev: v0.12.9 hooks: - id: ruff-check args: @@ -56,15 +56,14 @@ repos: files: ^binaries/ exclude: (^binaries/data/mods/(mod|public)/art/.*\.xml|\.dae$) - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.11.0-1 + rev: v3.12.0-2 hooks: - id: shfmt args: - --diff - - --simplify stages: [pre-commit] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1 hooks: - id: shellcheck - repo: https://github.com/igorshubovych/markdownlint-cli @@ -84,7 +83,7 @@ repos: args: - --strict - repo: https://github.com/eslint/eslint - rev: v9.27.0 + rev: v9.33.0 hooks: - id: eslint language_version: 22.14.0 diff --git a/source/tools/entity/checkrefs.py b/source/tools/entity/checkrefs.py index 31a1901820..3c801b4d03 100755 --- a/source/tools/entity/checkrefs.py +++ b/source/tools/entity/checkrefs.py @@ -167,7 +167,7 @@ class CheckRefs: self.inError = True if args.validate_meshes: - from validate_dae import DaeValidator + from validate_dae import DaeValidator # noqa: PLC0415 dv = DaeValidator(self.vfs_root, self.mods) self.inError = self.inError or not dv.run() diff --git a/source/tools/spirv/compile.py b/source/tools/spirv/compile.py index b8ca68ee34..b800aba017 100755 --- a/source/tools/spirv/compile.py +++ b/source/tools/spirv/compile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2024 Wildfire Games. +# Copyright (C) 2025 Wildfire Games. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -166,7 +166,7 @@ def compile_and_reflect(input_mod_path, dependencies, stage, path, out_path, def preprocessor_output_path = os.path.abspath( os.path.join(os.path.dirname(__file__), "preprocessed_file.glsl") ) - execute(command[:-2] + ["-g", "-E", "-o", preprocessor_output_path]) + execute([*command[:-2], "-g", "-E", "-o", preprocessor_output_path]) raise ValueError(err) spirv_reflect = get_spirv_reflect_location() diff --git a/source/tools/templatesanalyzer/unit_tables.py b/source/tools/templatesanalyzer/unit_tables.py index 10970d6925..8cb0f4c144 100755 --- a/source/tools/templatesanalyzer/unit_tables.py +++ b/source/tools/templatesanalyzer/unit_tables.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -# ruff: noqa: SIM115 +# ruff: noqa: FURB122,SIM115 import sys import xml.etree.ElementTree as ET