Skip to content

Commit 47f34bc

Browse files
committed
ci(super-linter): switch to super-linter
1 parent 6e85bce commit 47f34bc

File tree

5 files changed

+117
-56
lines changed

5 files changed

+117
-56
lines changed

.github/workflows/super-linter.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
#################################
3+
#################################
4+
## Super Linter GitHub Actions ##
5+
#################################
6+
#################################
7+
name: Lint Code Base
8+
9+
#
10+
# Documentation:
11+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
12+
#
13+
14+
#############################
15+
# Start the job on all push #
16+
#############################
17+
on:
18+
push:
19+
pull_request:
20+
schedule:
21+
- cron: "0 0 * * 0"
22+
workflow_dispatch:
23+
24+
permissions: {}
25+
26+
###############
27+
# Set the Job #
28+
###############
29+
jobs:
30+
lint:
31+
# Name the Job
32+
name: Lint Code Base
33+
# Set the agent to run on
34+
runs-on: ubuntu-latest
35+
36+
############################################
37+
# Grant status permission for MULTI_STATUS #
38+
############################################
39+
permissions:
40+
contents: read
41+
packages: read
42+
statuses: write
43+
44+
##################
45+
# Load all steps #
46+
##################
47+
steps:
48+
##########################
49+
# Checkout the code base #
50+
##########################
51+
- name: Checkout Code
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
with:
54+
# Full git history is needed to get a proper list of changed
55+
# files within `super-linter`
56+
fetch-depth: 0
57+
persist-credentials: false
58+
59+
################################
60+
# Run Linter against code base #
61+
################################
62+
- name: Lint Code Base
63+
uses: super-linter/super-linter@ffde3b2b33b745cb612d787f669ef9442b1339a6 # v8.1.0
64+
env:
65+
VALIDATE_ALL_CODEBASE: true
66+
LINTER_RULES_PATH: .
67+
DEFAULT_BRANCH: main
68+
ENFORCE_COMMITLINT_CONFIGURATION_CHECK: true
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/yamllint.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ to run using the following commands:
3636
`$ kext-swtich vbox`
3737
`$ kext-swtich status`
3838

39-
Shamelessly inspired of https://github.com/osxfuse/osxfuse/issues/315#issuecomment-271548072
39+
Shamelessly inspired of [https://github.com/osxfuse/osxfuse/issues/315#issuecomment-271548072](https://github.com/osxfuse/osxfuse/issues/315#issuecomment-271548072).

commitlint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const Configuration = {
2+
/*
3+
* Inherit rules from conventional commits.
4+
*/
5+
extends: ["@commitlint/config-conventional"],
6+
7+
/*
8+
* Any rules defined here will override rules from parent.
9+
*/
10+
rules: {
11+
"body-leading-blank": [2, "always"], // warning -> error
12+
"body-max-line-length": [1, "always", 100], // error -> warning
13+
"footer-leading-blank": [2, "always"], // warning -> error
14+
"footer-max-length": [1, "always", 100], // error -> warning
15+
"header-max-length": [1, "always", 100], // error -> warning
16+
},
17+
};
18+
19+
export default Configuration;

kext-switch

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@ set -euo pipefail
44
IFS=$'\n\t'
55

66
function status() {
7-
set +e
8-
kextstat 2> /dev/null | grep org.virtualbox.kext > /dev/null 2>&1 ;
9-
vbox=$((1-$?))
10-
kextstat 2> /dev/null | grep com.github.osxfuse > /dev/null 2>&1 ;
11-
fuse=$((1-$?))
12-
set -e
7+
set +e
8+
kextstat 2>/dev/null | grep org.virtualbox.kext >/dev/null 2>&1
9+
vbox=$((1 - $?))
10+
kextstat 2>/dev/null | grep com.github.osxfuse >/dev/null 2>&1
11+
fuse=$((1 - $?))
12+
set -e
1313
}
1414

1515
status
1616

17-
if [ $# -ne 0 ] && [ "$1" == "vbox" ] ; then
18-
if [ $vbox == 1 ] ; then
19-
echo "Already vbox"
20-
else
21-
sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
22-
sudo kextutil "/Library/Application Support/VirtualBox/VBoxDrv.kext" -r "/Library/Application Support/VirtualBox"
23-
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetAdp.kext" -r "/Library/Application Support/VirtualBox"
24-
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetFlt.kext" -r "/Library/Application Support/VirtualBox"
25-
sudo kextutil "/Library/Application Support/VirtualBox/VBoxUSB.kext" -r "/Library/Application Support/VirtualBox"
26-
fi
27-
elif [ $# -ne 0 ] && [ "$1" == "fuse" ] ; then
28-
if [ $fuse == 1 ] ; then
29-
echo "Already fuse"
30-
else
31-
sudo kextunload -b org.virtualbox.kext.VBoxUSB -b org.virtualbox.kext.VBoxNetFlt -b org.virtualbox.kext.VBoxNetAdp
32-
sudo kextunload -b org.virtualbox.kext.VBoxDrv
33-
sudo kextutil /Library/Filesystems/osxfuse.fs/Contents/Extensions/10.12/osxfuse.kext
34-
fi
35-
elif [ $# -ne 0 ] && [ "$1" == "status" ] ; then
36-
echo "vbox = $vbox"
37-
echo "fuse = $fuse"
17+
if [ $# -ne 0 ] && [ "$1" == "vbox" ]; then
18+
if [ $vbox == 1 ]; then
19+
echo "Already vbox"
20+
else
21+
sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
22+
sudo kextutil "/Library/Application Support/VirtualBox/VBoxDrv.kext" -r "/Library/Application Support/VirtualBox"
23+
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetAdp.kext" -r "/Library/Application Support/VirtualBox"
24+
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetFlt.kext" -r "/Library/Application Support/VirtualBox"
25+
sudo kextutil "/Library/Application Support/VirtualBox/VBoxUSB.kext" -r "/Library/Application Support/VirtualBox"
26+
fi
27+
elif [ $# -ne 0 ] && [ "$1" == "fuse" ]; then
28+
if [ $fuse == 1 ]; then
29+
echo "Already fuse"
30+
else
31+
sudo kextunload -b org.virtualbox.kext.VBoxUSB -b org.virtualbox.kext.VBoxNetFlt -b org.virtualbox.kext.VBoxNetAdp
32+
sudo kextunload -b org.virtualbox.kext.VBoxDrv
33+
sudo kextutil /Library/Filesystems/osxfuse.fs/Contents/Extensions/10.12/osxfuse.kext
34+
fi
35+
elif [ $# -ne 0 ] && [ "$1" == "status" ]; then
36+
echo "vbox = $vbox"
37+
echo "fuse = $fuse"
3838
else
39-
echo "Run $0 <vbox|fuse|status>"
39+
echo "Run $0 <vbox|fuse|status>"
4040
fi

0 commit comments

Comments
 (0)