diff --git a/.forgejo/pre-commit/config.yaml b/.forgejo/pre-commit/config.yaml index f1ab7765ef..a53fb19eb7 100644 --- a/.forgejo/pre-commit/config.yaml +++ b/.forgejo/pre-commit/config.yaml @@ -20,9 +20,9 @@ repos: - id: trailing-whitespace - repo: local hooks: - - id: aarch64-asm-indent - name: fix aarch64 assembly indentation - files: ^.*/aarch64/.*\.S$ + - id: arm-asm-indent + name: fix arm/aarch64 assembly indentation + files: ^.*/(arm|aarch64)/.*\.S$ language: script entry: ./tools/check_arm_indent.sh --apply pass_filenames: false diff --git a/tools/check_arm_indent.sh b/tools/check_arm_indent.sh index 37029aae3d..6444d8d1fb 100755 --- a/tools/check_arm_indent.sh +++ b/tools/check_arm_indent.sh @@ -33,12 +33,32 @@ fi ret=0 -for i in */aarch64/*.S */aarch64/*/*.S; do +for i in */aarch64/*.S */aarch64/*/*.S */arm/*.S; do case $i in libavcodec/aarch64/h264idct_neon.S|libavcodec/aarch64/h26x/epel_neon.S|libavcodec/aarch64/h26x/qpel_neon.S|libavcodec/aarch64/vc1dsp_neon.S) # Skip files with known (and tolerated) deviations from the tool. continue ;; + libavcodec/arm/jrevdct_arm.S) + # This file has a large copyright header that gets reindented like code. + continue + ;; + libavcodec/arm/mlpdsp_armv5te.S|libavcodec/arm/mlpdsp_armv6.S) + # These files use a bit more gas directives than most files, and the + # reindenter script would need a lot of manual fixups to make this + # look good, so keep it as is. + continue + ;; + libavcodec/arm/vc1dsp_neon.S|libavutil/arm/float_dsp_vfp.S) + # These files use different indentation levels to signify different + # levels in unrolling. + continue + ;; + libavcodec/arm/simple_idct_arm.S|libavcodec/arm/simple_idct_armv5te.S|libavcodec/arm/simple_idct_armv6.S) + # These files use defines for constants, like "W26", that get mistaken + # as register names and get lowercased by the script. + continue + ;; esac ./tools/indent_arm_assembly.pl < "$i" > tmp.S || ret=$? if ! git diff --quiet --no-index "$i" tmp.S; then