mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
* Add basic setup for precommit * Update README.md with instructions on installing precommit hooks --------- Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com> Co-authored-by: Bartlomiej Wroblewski <bwroblewski10@gmail.com>
This commit is contained in:
20
script/install_precommit.sh
Executable file
20
script/install_precommit.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
run_and_check() {
|
||||
"$@"
|
||||
status=$?
|
||||
if [ $status -ne 0 ]; then
|
||||
echo "Error with \"$@\": Exited with status $status"
|
||||
exit $status
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
echo "I: Installing tools required for pre-commit checks..."
|
||||
run_and_check apt install clang-format-10
|
||||
|
||||
echo "I: Installing pre-commit itself..."
|
||||
run_and_check pip3 install pre-commit
|
||||
run_and_check pre-commit install
|
||||
|
||||
echo "I: Installation successful."
|
||||
Reference in New Issue
Block a user