forked from 24OI/linter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
lint.sh
executable file
·48 lines (37 loc) · 921 Bytes
/
lint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
export PATH=$PATH:~/.local/bin
set -xo pipefail
echo $UID
echo $USER
echo $PATH
which clang-format
which ruff
clang-format --version
ruff --version
# source /root/.bashrc
num=$RANDOM
git clone --depth=1 -b $3 https://github.com/$1/$2.git $num
cd $num
# rm yarn.lock
# rm package-lock.json
# cp /root/package.json .
# npm install .
# yarn add .
if [[ -f package-lock.json ]]; then
npm install .
else
yarn
fi
git config --local user.email "[email protected]"
git config --local user.name "24OI-bot"
find . -type f -name "*.cpp" -print0 | xargs -0 clang-format -i
ruff format ./docs
yarn run remark ./docs -o --silent
# find . -type f -name "*.hpp" | xargs clang-format -i
git add ./docs
git commit -m 'style: format markdown files with remark-lint'
git remote add upd https://24OI-bot:[email protected]/$1/$2.git
git push upd $3
cd ..
rm -rf $num
yarn cache clean