mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
chore(lint): Linted scripts, yaml and configs
This commit is contained in:
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@@ -1,6 +1,5 @@
|
||||
version: 2
|
||||
updates:
|
||||
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
|
||||
5
.github/workflows/changelog.yml
vendored
5
.github/workflows/changelog.yml
vendored
@@ -1,22 +1,17 @@
|
||||
---
|
||||
name: Debug Changelog # Workflow name displayed on GitHub
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Trigger manually
|
||||
|
||||
jobs:
|
||||
debug-changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Create changelog text
|
||||
id: changelog
|
||||
uses: loopwerk/tag-changelog@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config_file: .github/tag-changelog-config.js
|
||||
|
||||
- name: "Echo results"
|
||||
id: output-changelog
|
||||
run: |
|
||||
|
||||
7
.github/workflows/new-release.yml
vendored
7
.github/workflows/new-release.yml
vendored
@@ -1,14 +1,10 @@
|
||||
---
|
||||
name: Release Daily State # Workflow name displayed on GitHub
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Trigger manually
|
||||
schedule:
|
||||
- cron: "30 20 * * *" # UTC is 2-3 hours behind Europe/Helsinki, my timezone
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
new-daily-release:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -17,11 +13,9 @@ jobs:
|
||||
version: ${{ steps.daily-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3 # Checkout our working repository
|
||||
|
||||
- name: Create tag if necessary
|
||||
uses: fregante/daily-version-action@v2
|
||||
id: daily-version
|
||||
|
||||
- name: Create changelog text
|
||||
if: steps.daily-version.outputs.created
|
||||
id: changelog
|
||||
@@ -29,7 +23,6 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config_file: .github/tag-changelog-config.js
|
||||
|
||||
- name: Create release
|
||||
if: steps.daily-version.outputs.created
|
||||
uses: actions/create-release@latest
|
||||
|
||||
6
.github/workflows/update-submodules.yml
vendored
6
.github/workflows/update-submodules.yml
vendored
@@ -1,13 +1,11 @@
|
||||
name: Update submodules
|
||||
on:
|
||||
schedule: [cron: 0 3 * * *]
|
||||
schedule: [{cron: 0 3 * * *}]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update-submodules:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -18,12 +16,10 @@ jobs:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
- name: Config Git User
|
||||
run: |
|
||||
git config --global user.name "${{ github.actor }}"
|
||||
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
|
||||
- name: Update submodules
|
||||
run: |
|
||||
if git commit -am"chore(git): Update submodules (automated)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck source="../scripts/shared.sh"
|
||||
# shellcheck disable=1091,2139
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Get installed php versions from brew and setup aliases
|
||||
|
||||
@@ -1,24 +1,19 @@
|
||||
---
|
||||
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
|
||||
# editor: $EDITOR
|
||||
|
||||
# Should 'cheat' always colorize output?
|
||||
colorize: true
|
||||
|
||||
# Which 'chroma' colorscheme should be applied to the output?
|
||||
# Options are available here:
|
||||
# https://github.com/alecthomas/chroma/tree/master/styles
|
||||
style: "catppuccin"
|
||||
|
||||
# Which 'chroma' "formatter" should be applied?
|
||||
# One of: "terminal", "terminal256", "terminal16m"
|
||||
formatter: terminal256
|
||||
|
||||
# Through which pager should output be piped?
|
||||
# 'less -FRX' is recommended on Unix systems
|
||||
# 'more' is recommended on Windows
|
||||
pager: less -FRX
|
||||
|
||||
# Cheatpaths are paths at which cheatsheets are available on your local
|
||||
# filesystem.
|
||||
#
|
||||
@@ -63,21 +58,21 @@ cheatpaths:
|
||||
# 'readonly': shall user-created ('cheat -e') cheatsheets be saved here?
|
||||
- name: community
|
||||
path: ~/.config/cheat/cheatsheets/community
|
||||
tags: [ community ]
|
||||
tags: [community]
|
||||
readonly: true
|
||||
# If you have personalized cheatsheets, list them last. They will take
|
||||
# precedence over the more global cheatsheets.
|
||||
- name: personal
|
||||
path: ~/.dotfiles/config/cheat/cheatsheets/personal
|
||||
tags: [ personal ]
|
||||
tags: [personal]
|
||||
readonly: false
|
||||
- name: pure-bash-bible
|
||||
path: ~/.dotfiles/config/cheat/cheatsheets/pure-bash-bible
|
||||
tags: [ pure-bash-bible ]
|
||||
tags: [pure-bash-bible]
|
||||
readonly: true
|
||||
- name: tldr
|
||||
path: ~/.dotfiles/config/cheat/cheatsheets/tldr
|
||||
tags: [ tldr ]
|
||||
tags: [tldr]
|
||||
readonly: true
|
||||
|
||||
# While it requires no configuration here, it's also worth noting that
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# shellcheck enable=external-sources
|
||||
# shellcheck disable=1091
|
||||
# shellcheck disable=1091,2139
|
||||
# vim: filetype=zsh
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
#
|
||||
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
|
||||
|
||||
__pushover_usage() {
|
||||
__pushover_usage()
|
||||
{
|
||||
printf "pushover <options> <message>\n"
|
||||
printf " -c <callback>\n"
|
||||
printf " -d <device>\n"
|
||||
@@ -22,7 +23,8 @@ __pushover_usage() {
|
||||
return 1
|
||||
}
|
||||
|
||||
__pushover_opt_field() {
|
||||
__pushover_opt_field()
|
||||
{
|
||||
field=$1
|
||||
shift
|
||||
value="${*}"
|
||||
@@ -31,7 +33,8 @@ __pushover_opt_field() {
|
||||
fi
|
||||
}
|
||||
|
||||
__pushover_send_message() {
|
||||
__pushover_send_message()
|
||||
{
|
||||
device="${1:-}"
|
||||
|
||||
curl_cmd="\"${CURL}\" -s -S \
|
||||
@@ -71,8 +74,7 @@ devices="${devices} ${device}"
|
||||
optstring="c:d:D:e:f:p:r:t:T:s:u:U:a:h"
|
||||
|
||||
OPTIND=1
|
||||
while getopts ${optstring} c
|
||||
do
|
||||
while getopts ${optstring} c; do
|
||||
case ${c} in
|
||||
c)
|
||||
callback="${OPTARG}"
|
||||
@@ -117,7 +119,7 @@ do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
__pushover_usage
|
||||
@@ -141,9 +143,8 @@ else
|
||||
__pushover_send_message "${device}"
|
||||
r=${?}
|
||||
if [ "${r}" -ne 0 ]; then
|
||||
break;
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
exit "${r}"
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ file_2="$2"
|
||||
|
||||
# return sha256sum for file
|
||||
# $1 - filename (string)
|
||||
get_sha256sum() {
|
||||
get_sha256sum()
|
||||
{
|
||||
sha256sum "$1" | head -c 64
|
||||
}
|
||||
|
||||
@@ -22,11 +23,13 @@ get_sha256sum() {
|
||||
echo "Usage: $0 file1.sh file2.sh" && exit 1
|
||||
}
|
||||
|
||||
msg() {
|
||||
msg()
|
||||
{
|
||||
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
|
||||
}
|
||||
|
||||
error() {
|
||||
error()
|
||||
{
|
||||
msg "(!) ERROR: $1" && exit 1
|
||||
}
|
||||
|
||||
@@ -45,6 +48,5 @@ if [ "$file_1_hash" != "$file_2_hash" ]; then
|
||||
error "Files do not match"
|
||||
else
|
||||
msg "(*) Success: Files do match"
|
||||
exit 0;
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
# Helper env variables. Use like this: VERBOSE=1 ./script.sh
|
||||
: "${VERBOSE:=0}"
|
||||
|
||||
|
||||
# -- Colors -- #
|
||||
CLR_RED="\033[1;31m"
|
||||
CLR_YELLOW="\033[1;33m"
|
||||
@@ -254,11 +253,11 @@ function replacable()
|
||||
|
||||
[[ ! -r "$FILE1" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "File 1 ($FILE1) does not exist"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
[[ ! -r "$FILE2" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "File 2 ($FILE2) does not exist, replacable"
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
FILE1_HASH=$(get_sha256sum "$FILE1")
|
||||
@@ -266,20 +265,19 @@ function replacable()
|
||||
|
||||
[[ $FILE1_HASH = "" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 1 ($FILE1)"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
[[ $FILE2_HASH = "" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_err "Could not get hash for file 2 ($FILE2), replacable"
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
|
||||
[[ $VERBOSE -eq 1 ]] && msg_ok "Files match, not replacable: $FILE1"
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ $VERBOSE -eq 1 ]] && msg_warn "Files do not match ($FILE1_HASH != $FILE2_HASH), replacable"
|
||||
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
link:
|
||||
create: true
|
||||
relink: true
|
||||
exclude: [ "*.md", "*renovate*", "LICENSE" ]
|
||||
exclude: ["*.md", "*renovate*", "LICENSE"]
|
||||
shell:
|
||||
stdout: true
|
||||
|
||||
Reference in New Issue
Block a user