mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
add script to pre commit hooks for checking file permissions (#2322)
This commit is contained in:
@@ -12,3 +12,9 @@ repos:
|
||||
verbose: false
|
||||
language: script
|
||||
types: [c++]
|
||||
- id: remove-exec-bit
|
||||
name: Remove executable bit from non-executable files
|
||||
entry: script/remove_exec_bit.sh
|
||||
language: script
|
||||
types_or: [c++, text]
|
||||
verbose: true
|
||||
|
||||
8
script/remove_exec_bit.sh
Executable file
8
script/remove_exec_bit.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
for file in $(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|hpp|txt|inc)$'); do
|
||||
if [ -x "$file" ]; then
|
||||
chmod -x "$file"
|
||||
echo "[remove-exec-bit] Removed executable bit from $file" >&2
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user