From 5507c907185ee1bb3e9bb50245a2ee5c29b75ef9 Mon Sep 17 00:00:00 2001 From: dylanhitt Date: Fri, 5 Apr 2024 12:50:02 -0400 Subject: [PATCH] ci: add linters --- .github/workflows/lint.yaml | 29 ++++++++++++ .luacheckrc | 1 + kek.yaml | 93 +++++++++++++++++++++++++++++++++++++ setup.sh | 21 ++++----- 4 files changed, 133 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/lint.yaml create mode 100644 .luacheckrc create mode 100644 kek.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..69c9fa0 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,29 @@ +name: lint + +on: + pull_request: + push: + branches: + - "main" + +jobs: + luacheck: + name: Luacheck + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Luacheck linter + uses: lunarmodules/luacheck@v1.1.2 + + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@2.0.0 + with: + ignore_names: >- + .profile + .zshrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..2a1c1d7 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1 @@ +globals = { "vim" } -- these globals can only be accessed. diff --git a/kek.yaml b/kek.yaml new file mode 100644 index 0000000..664cec8 --- /dev/null +++ b/kek.yaml @@ -0,0 +1,93 @@ +cluster: nws-dev-west +kind: SoloDevice +apiVersion: carbonite.nowsecure.io/v1 +metadata: + name: 6013a379-aa26-4481-9176-1c80c8b1037f + uid: 6efe2fe6-8f00-45f9-9d2e-4e1ceb64753e + resourceVersion: '889674137' + generation: 127652 + creationTimestamp: '2024-01-04T18:01:54Z' + labels: + kustomize.toolkit.fluxcd.io/name: apps + kustomize.toolkit.fluxcd.io/namespace: flux-system + platform: ios + serial: 00008110-028BD494F4AEA278 + annotations: + carbonite.nowsecure.io/disable-fleet-guided-sync: '' + carbonite.nowsecure.io/enablement-reason: Provisioning Device + kustomize.toolkit.fluxcd.io/ssa: merge + onetime.carbonite.nowsecure.io/upgrade-spec: 'true' +attrs: + serial: 00008110-028BD494F4AEA278 + platform: ios + version: 16.1.2 + environment: integration + model: ipad + userDefined: + type: Corellium +spec: + enabled: true + guided: false + signingProfile: FFC501284C1D4AEEE8BFDB43E332B6ACABFC2563 + type: Corellium + appium: + image: registry.nowsecure.io/nowsecure/appium-server:v3.0.0-rc.3 + bridge: + image: registry.nowsecure.io/nowsecure/device-bridges:v2.0.0 + dynamic: + image: >- + registry.nowsecure.io/viaforensics/vmatrix-ios-dynamic-analysis:v2.5.0-rc.4 + devDisk: + image: registry.nowsecure.io/viaforensics/vmatrix-ios-devdiskimages:v1.0.3 + corellium: + id: 6013a379-aa26-4481-9176-1c80c8b1037f + serial: 00008110-028BD494F4AEA278 + ip: 10.122.13.1 + ssh: + username: root + password: alpine + provision: [] +status: + corellium: + snapshot: + action: + startTime: start time + name: CorelliumRecovery + state: begin/inProgress/finished + allocated: false + presentOnUSB: false + presentOnBridge: false + trusted: false + health: + lastUpdateTime: '2024-03-06T15:15:56Z' + status: GOOD + ipAddress: 10.122.12.1 + battery: 90 + storageUsage: 49.15231 + jailbreak: true + hasInternet: true + conditions: + - type: Monitored + status: 'True' + lastUpdateTime: '2024-03-06T15:15:56Z' + - type: Bridge + status: 'True' + lastUpdateTime: '2024-01-19T18:27:42Z' + - type: DeviceAgent + status: 'True' + lastUpdateTime: '2024-01-04T18:01:56Z' + jobStats: + consecutiveSuccesses: 0 + consecutiveFailures: 0 + history: null + provision: + # max of 3 + history: + - startTime: time + success: bool + name: provision-job-name + - startTime: + success: bool + name: provision-job-name + lastAttemptedTime: null + failedAttempts: 0 diff --git a/setup.sh b/setup.sh index 01b3413..29b2e93 100755 --- a/setup.sh +++ b/setup.sh @@ -17,7 +17,7 @@ info() { # ======== command_check() { - if ! command -v $1 &> /dev/null; then + if ! command -v "${1}" &> /dev/null; then error "In order to use this script, ${1} must be installed" exit 1 fi @@ -29,7 +29,7 @@ command_check() { install_nvim() { info "Installing nvim" - mkdir -p $NVIM_DIR + mkdir -p "$NVIM_DIR" case "$OS" in Linux) apt-get install -y neovim @@ -70,7 +70,7 @@ install_node() { # ========= SCRIPTS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; -pushd $SCRIPTS_DIR > /dev/null +pushd "$SCRIPTS_DIR" || exit 1 > /dev/null SOURCE_DIR=$PWD NVIM_DIR="${HOME}/.config/nvim" @@ -80,7 +80,6 @@ NVIM_DIR="${HOME}/.config/nvim" # ================== OS="" -ARCH=$(uname -m) case $(uname) in Linux*) OS="Linux" @@ -145,16 +144,16 @@ info "Symlink dotfiles to ${HOME}" sleep 3 # BASH -ln -sf ${SOURCE_DIR}/.profile ${HOME}/.profile +ln -sf "${SOURCE_DIR}/.profile" "${HOME}/.profile" # ZSH -[[ ! -e ${HOME}/.zshrc ]] && cp ${SOURCE_DIR}/.zshrc ${HOME}/.zshrc -ln -sf ${SOURCE_DIR}/.zshrc ${HOME}/.zshrc +[[ ! -e "${HOME}/.zshrc" ]] && cp "${SOURCE_DIR}/.zshrc" "${HOME}/.zshrc" +ln -sf "${SOURCE_DIR}/.zshrc" "${HOME}/.zshrc" # NVIM -ln -sf ${SOURCE_DIR}/.config/nvim/init.lua ${NVIM_DIR}/init.lua -ln -sfh ${SOURCE_DIR}/.config/nvim/lua ${NVIM_DIR}/lua +ln -sf "${SOURCE_DIR}/.config/nvim/init.lua" "${NVIM_DIR}/init.lua" +ln -sfh "${SOURCE_DIR}/.config/nvim/lua" "${NVIM_DIR}/lua" # GIT -ln -sf ${SOURCE_DIR}/.gitconfig ${HOME}/.gitconfig -ln -sf ${SOURCE_DIR}/.gitconfig-github ${HOME}/.gitconfig-github +ln -sf "${SOURCE_DIR}/.gitconfig" "${HOME}/.gitconfig" +ln -sf "${SOURCE_DIR}/.gitconfig-github" "${HOME}/.gitconfig-github"