Skip to content

Commit 3433ada

Browse files
committed
Fix code inscpector violations
Fix code inscpector violations Signed-off-by: Bensuperpc <[email protected]>
1 parent 430aea9 commit 3433ada

File tree

6 files changed

+60
-60
lines changed

6 files changed

+60
-60
lines changed

.github/workflows/code-inspector.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@ name: code-inspector
33
on:
44
push:
55
branches:
6-
- '*'
6+
- '*'
77
paths-ignore:
88
- '**/README.md'
99
pull_request:
1010
branches:
11-
- '*'
11+
- '*'
1212
workflow_dispatch:
1313

1414
jobs:
1515
check-quality:
1616
runs-on: ubuntu-latest
1717
name: A job to check my code quality
1818
steps:
19-
- name: Check code meets quality standards
20-
id: code-inspector
21-
uses: codeinspectorio/github-action@master
22-
with:
23-
repo_token: ${{ secrets.GITHUB_TOKEN }}
24-
code_inspector_access_key: ${{ secrets.CODE_INSPECTOR_ACCESS_KEY }}
25-
code_inspector_secret_key: ${{ secrets.CODE_INSPECTOR_SECRET_KEY }}
26-
min_quality_grade: 'WARNING'
27-
min_quality_score: '50'
28-
max_defects_rate: '0.0001'
29-
max_complex_functions_rate: '0.0001'
30-
max_long_functions_rate: '0.0001'
31-
project_name: ''
32-
max_timeout_sec: '600'
19+
- name: Check code meets quality standards
20+
id: code-inspector
21+
uses: codeinspectorio/github-action@master
22+
with:
23+
repo_token: ${{ secrets.GITHUB_TOKEN }}
24+
code_inspector_access_key: ${{ secrets.CODE_INSPECTOR_ACCESS_KEY }}
25+
code_inspector_secret_key: ${{ secrets.CODE_INSPECTOR_SECRET_KEY }}
26+
min_quality_grade: 'WARNING'
27+
min_quality_score: '50'
28+
max_defects_rate: '0.0001'
29+
max_complex_functions_rate: '0.0001'
30+
max_long_functions_rate: '0.0001'
31+
project_name: ''
32+
max_timeout_sec: '600'

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: scripts
33
on:
44
push:
55
branches:
6-
- '*'
6+
- '*'
77
paths-ignore:
88
- '**/README.md'
99
pull_request:
1010
branches:
11-
- '*'
11+
- '*'
1212
schedule:
1313
- cron: '0 22 */7 * *' # every 7 days https://crontab.guru/#0_7_*_*_1
1414
workflow_dispatch:

archive/extract.sh

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,39 @@ set -euo pipefail
2525
extractAllTypeFiles(){
2626
if [ -f $1 ] ; then
2727
case $1 in
28-
*.ark) arc x $1 ;;
29-
*.arc) arc x $1 ;;
30-
*.arj) arj e $1 ;;
28+
*.ark) arc x "$1" ;;
29+
*.arc) arc x "$1" ;;
30+
*.arj) arj e "$1" ;;
3131
*.cbt) tar xvf $1 ;;
32-
*.cso) ciso 0 ./"$n" ./"$n.iso" && \
33-
extract $n.iso && \rm -f $n ;;
34-
*.tar.bz2) tar xvjf $1 ;;
35-
*.tar.gz) tar xvzf $1 ;;
36-
*.tar.lzma) tar --lzma -xvf $1 ;;
37-
*.tar.xz) tar -xf $1 ;;
38-
*.tar.lz) lzip -d $1 ;; #tar --lzip -tf $1 ;;
39-
*.tar.7z) 7z x -so $1 | tar -xf - ;; # tar -cJf
40-
*.tar.Z) zcat $1 | tar -xvf - ;;
41-
*.jar) jar xf $1 ;;
42-
*.bz2) bunzip2 $1 ;;
43-
*.rar) unrar x $1 ;;
44-
*.cbr) unrar x -ad $1 ;;
45-
*.gz) gunzip $1 ;;
46-
*.cab) cabextract $1 ;;
47-
*.cpio) cpio -id < $1 ;;
48-
*.cba|*.ace) unace x $1 ;;
49-
*.tar) tar xvf $1 ;;
50-
*.tbz2) tar xvjf $1 ;;
51-
*.tgz) tar xvzf $1 ;;
52-
*.lz4) lz4 -d $1 ;;
53-
*.lzh) lha x $1 ;;
54-
*.xz) unxz $1 ;;
55-
*.exe) cabextract $1 ;;
56-
*.zip|*.epub|*.cbz) unzip $1 ;;
57-
*.7z|*.z|*.apk|*.deb|*.dmg|*.lzh|*.msi|*.pkg|*.rpm|*.udf|*.wim|*.xar) 7z x $1 ;;
58-
*.zst) zstd -dc $1 ;;
59-
*.zpaq) zpaq x $1 ;;
60-
*.zoo) zoo -extract $1 ;;
32+
*.cso) ciso 0 ./"$1" ./"$1.iso" && \
33+
extract $1.iso && \rm -f "$1" ;;
34+
*.tar.bz2) tar xvjf "$1" ;;
35+
*.tar.gz) tar xvzf "$1" ;;
36+
*.tar.lzma) tar --lzma -xvf "$1" ;;
37+
*.tar.xz) tar -xf "$1" ;;
38+
*.tar.lz) lzip -d "$1" ;; #tar --lzip -tf $1 ;;
39+
*.tar.7z) 7z x -so "$1" | tar -xf - ;; # tar -cJf
40+
*.tar.Z) zcat "$1" | tar -xvf - ;;
41+
*.jar) jar xf "$1" ;;
42+
*.bz2) bunzip2 "$1" ;;
43+
*.rar) unrar x "$1" ;;
44+
*.cbr) unrar x -ad "$1" ;;
45+
*.gz) gunzip "$1" ;;
46+
*.cab) cabextract "$1" ;;
47+
*.cpio) cpio -id < "$1" ;;
48+
*.cba|*.ace) unace x "$1" ;;
49+
*.tar) tar xvf "$1" ;;
50+
*.tbz2) tar xvjf "$1" ;;
51+
*.tgz) tar xvzf "$1" ;;
52+
*.lz4) lz4 -d "$1" ;;
53+
*.lzh) lha x "$1" ;;
54+
*.xz) unxz "$1" ;;
55+
*.exe) cabextract "$1" ;;
56+
*.zip|*.epub|*.cbz) unzip "$1" ;;
57+
*.7z|*.z|*.apk|*.deb|*.dmg|*.lzh|*.msi|*.pkg|*.rpm|*.udf|*.wim|*.xar) 7z x "$1" ;;
58+
*.zst) zstd -dc "$1" ;;
59+
*.zpaq) zpaq x "$1" ;;
60+
*.zoo) zoo -extract "$1" ;;
6161
*) echo "File not supported : '$1'..." ;;
6262
esac
6363
else

linux/hash/hash_gen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ fi
3030
#find $1 -type f -name "*" ! -name "checksums.*" | parallel -j $(nproc) ${TYPE}sum > checksums.${TYPE}
3131

3232
TYPE=sha3-512
33-
find $1 -type f -name "*" ! -name "checksums.*" | parallel -j $(nproc) rhash --${TYPE} > checksums.${TYPE}
33+
find "$1" -type f -name "*" ! -name "checksums.*" | parallel -j $(nproc) rhash --${TYPE} > checksums.${TYPE}
3434
echo "OK"

linux/sysinfo.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ else
3333
fi
3434

3535
tmpdir="sysinfo-$(date +'%Y%m%d-%H%M%S-%Z')"
36-
mkdir $tmpdir || exit $?
37-
cd $tmpdir
36+
mkdir "$tmpdir" || exit $?
37+
cd "$tmpdir"
3838

3939
#PATH=/usr/sbin:/usr/bin:/sbin:/bin
4040

@@ -105,8 +105,8 @@ echo "Done"
105105
find -type f -empty -delete
106106

107107
cd ..
108-
XZ_OPT=-e9 tar cJf "${tmpdir}.tar.xz" $tmpdir
109-
rm -rf $tmpdir
108+
XZ_OPT=-e9 tar cJf "${tmpdir}.tar.xz" "$tmpdir"
109+
rm -rf "$tmpdir"
110110

111111
echo
112112
echo "System information archive has been created:"

partition/luks.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ fi
3535
if (( $# == 2 )); then
3636
UUID=$(uuidgen)
3737
echo "UUID: ${UUID}"
38-
sudo umount $1 || true
39-
sudo cryptsetup -v --type luks --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 1000 --use-urandom --verify-passphrase luksFormat --label=$2 $1
40-
sudo cryptsetup -v luksOpen $1 ${UUID}
41-
sudo mkfs.btrfs --force --checksum blake2 --label $2 /dev/mapper/${UUID}
38+
sudo umount "$1" || true
39+
sudo cryptsetup -v --type luks --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 1000 --use-urandom --verify-passphrase luksFormat --label="$2" "$1"
40+
sudo cryptsetup -v luksOpen "$1" "${UUID}"
41+
sudo mkfs.btrfs --force --checksum blake2 --label "$2" /dev/mapper/${UUID}
4242

43-
sudo cryptsetup -v luksClose ${UUID}
43+
sudo cryptsetup -v luksClose "${UUID}"
4444
echo "Partition: OK"
4545
echo "Now you can unplug, replug device and use it :) "
4646
else

0 commit comments

Comments
 (0)