Skip to content

Commit

Permalink
Merge branch 'master' into dev-defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton authored Feb 22, 2024
2 parents 4d3e6fb + c5298fd commit 85075d3
Show file tree
Hide file tree
Showing 494 changed files with 12,698 additions and 6,250 deletions.
Empty file modified .editorconfig
100755 → 100644
Empty file.
Empty file modified .github/FUNDING.yml
100755 → 100644
Empty file.
4 changes: 3 additions & 1 deletion .github/workflows/dorothy-workflow.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
PKG_CONFIG_PATH: '' # fix: https://github.com/bevry/dorothy/actions/runs/6349881708/job/17248752072#step:8:8
LDFLAGS: '' # fix: https://github.com/bevry/dorothy/actions/runs/6349927188/job/17248892389#step:8:9
CPPFLAGS: '' # fix: https://github.com/bevry/dorothy/actions/runs/6349956372/job/17248986621#step:8:10
shell: xonsh -l {0}
CXX: '' # fix: https://github.com/bevry/dorothy/actions/runs/7538723888/job/20519802798#step:8:12
CC: '' #fix: https://github.com/bevry/dorothy/actions/runs/7538922544/job/20520381661#step:8:13
shell: xonsh -DXONSH_SHOW_TRACEBACK=True -l {0}
run: |
command-exists dorothy
echo-style --success='ok'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ basic.vim

# custom to dorothy
user
state
Empty file modified .trunk/configs/.markdownlint.yaml
100755 → 100644
Empty file.
Empty file modified .trunk/configs/.prettierrc.yaml
100755 → 100644
Empty file.
Empty file modified .trunk/configs/.shellcheckrc
100755 → 100644
Empty file.
Empty file modified .trunk/configs/.yamllint.yaml
100755 → 100644
Empty file.
Empty file modified .trunk/configs/eslint.config.js
100755 → 100644
Empty file.
Empty file modified .trunk/configs/ruff.toml
100755 → 100644
Empty file.
26 changes: 13 additions & 13 deletions .trunk/trunk.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# https://features.trunk.io/check/p/trunk-doesnt-work-in-nested-repo
version: 0.1
cli:
version: 1.17.2
version: 1.19.0
plugins:
sources:
- id: trunk
ref: v1.2.6
ref: v1.4.2
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
Expand All @@ -21,21 +21,21 @@ actions:
lint:
enabled:
- actionlint@1.6.26
- black@23.9.1
- checkov@3.0.32
- eslint@8.53.0
- flake8@6.1.0
- black@24.2.0
- checkov@3.2.20
- eslint@8.56.0
- flake8@7.0.0
- git-diff-check@SYSTEM
- gitleaks@8.18.0
- isort@5.12.0
- markdownlint@0.37.0
- prettier@3.0.3
- ruff@0.1.5
- gitleaks@8.18.2
- isort@5.13.2
- markdownlint@0.39.0
- prettier@3.2.5
- ruff@0.2.1
- shellcheck@0.9.0
- shfmt@3.7.0
- taplo@0.8.1
- trufflehog@3.62.1
- yamllint@1.33.0
- trufflehog@3.67.6
- yamllint@1.34.0
disabled:
- trivy
- oxipng # broken for some reason on my mac mini
Expand Down
Empty file modified .vscode/extensions.json
100755 → 100644
Empty file.
Empty file modified .vscode/settings.json
100755 → 100644
Empty file.
36 changes: 18 additions & 18 deletions .vscode/workspace.code-workspace
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
],
"settings": {
"cSpell.words": [
"balupton",
"Bash",
"Builtins",
"doas",
"dotfile",
"dotfiles",
"Mageia",
"molleweide",
"pacman",
"POSIX",
"Roadmap",
"Subshells",
"sumitrai",
"xbps",
"Xonsh",
"Zsh",
"Bevry"
]
"balupton",
"Bash",
"Builtins",
"doas",
"dotfile",
"dotfiles",
"Mageia",
"molleweide",
"pacman",
"POSIX",
"Roadmap",
"Subshells",
"sumitrai",
"xbps",
"Xonsh",
"Zsh",
"Bevry"
]
}
}
Empty file modified CONTRIBUTING.md
100755 → 100644
Empty file.
8 changes: 4 additions & 4 deletions LICENSE.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!-- LICENSEFILE/ -->

<h1>License</h1>
# License

Unless stated otherwise all works are:

<ul><li>Copyright &copy; 2013+ <a href="https://github.com/balupton">Benjamin Lupton</a></li></ul>
- Copyright &copy; [Benjamin Lupton](https://balupton.com)

and licensed under:

<ul><li><a href="http://spdx.org/licenses/RPL-1.5.html">Reciprocal Public License 1.5</a></li></ul>
- [Reciprocal Public License 1.5](http://spdx.org/licenses/RPL-1.5.html)

<h2>Reciprocal Public License 1.5 (RPL1.5)</h2>
## Reciprocal Public License 1.5 (RPL1.5)

<pre>
Version 1.5, July 15, 2007
Expand Down
262 changes: 223 additions & 39 deletions README.md
100755 → 100644

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions commands.beta/echo-escape-special
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function echo_escape_special() (
# exit status: 0
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

Expand Down
3 changes: 3 additions & 0 deletions commands.beta/echo-if-directory
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ function echo_if_directory() (
# exit status: 0
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

Expand Down
99 changes: 99 additions & 0 deletions commands.beta/echo-if-empty
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env bash

function echo_if_empty() (
source "$DOROTHY/sources/stdinargs.bash"

function help {
cat <<-EOF >/dev/stderr
ABOUT:
Output <fallback> if <input> is empty.
USAGE:
echo-if-empty <fallback> [...options] [--] ...<input>
echo-lines ...<input> | echo-if-empty <fallback> [...options]
OPTIONS:
<fallback> | --fallback=<fallback>
The fallback to use if <input> is empty.
$(stdinargs_options_help --)
EXAMPLE:
echo-if-empty 'my-fallback-value'
my-fallback-value
# exit status: 0
echo | echo-if-empty 'my-fallback-value'
my-fallback-value
# exit status: 0
echo 'a-value' | echo-if-empty 'my-fallback-value'
'a-value'
# exit status: 0
ALTERNATIVES:
Use [ifne] from [moreutils], which is what we use in [eval-on-empty-stdin] and [eval-on-not-empty-stdin].
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

# process our own arguments, delegate everything else to stdinargs
local rand="$RANDOM"
local item option_fallback="$rand" option_args=()
while test "$#" -ne 0; do
item="$1"
shift
case "$item" in
'--help' | '-h') help ;;
'--fallback='*) option_fallback="${item#*=}" ;;
# forward to stdinargs, however support mixing and matching of our options, with stdinarg options
'--')
option_args+=("$item" "$@")
shift $#
break
;;
'--'*) option_args+=("$item") ;;
*)
if test "$option_fallback" = "$rand"; then
option_fallback="$item"
else
option_args+=("$item")
fi
;;
esac
done

# checck for expected
if test "$option_fallback" = "$rand"; then
help "Missing required argument: <expected>"
fi

# action
local inputs=''
function on_inline {
inputs+="$1"
}
function on_line {
inputs+="$1"$'\n'
}
function on_finish {
if is-empty-string -- "$inputs"; then
print_string "$fallback"
else
print_string "$inputs"
fi
}
stdinargs "${option_args[@]}"
)

# fire if invoked standalone
if test "$0" = "${BASH_SOURCE[0]}"; then
echo_if_empty "$@"
fi
5 changes: 4 additions & 1 deletion commands.beta/echo-if-executable
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function echo_if_executable() (
EXAMPLE:
touch executable
chmodx +x executable
chmod +x executable
touch file
echo-if-file -- executable file missing
Expand All @@ -32,6 +32,9 @@ function echo_if_executable() (
# exit status: 0
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

Expand Down
5 changes: 4 additions & 1 deletion commands.beta/echo-if-path
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ function echo_if_path() (
# exit status: 0
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

function on_input {
if is-present "$1"; then
if is-present -- "$1"; then
print_line "$1"
fi
}
Expand Down
3 changes: 3 additions & 0 deletions commands.beta/echo-nonflags
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function echo_nonflags() (
code -a --b c
# exit status: 0
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

Expand Down
7 changes: 5 additions & 2 deletions commands.beta/echo-numeric
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# this command should have a --fallback (or be used with echo-on-empty-stdin), or a --quiet to suppress the error
# this command should have a --fallback (or be used with echo-trim-empty-lines), or a --quiet to suppress the error
function echo_numeric() (
source "$DOROTHY/sources/stdinargs.bash"

Expand Down Expand Up @@ -38,12 +38,15 @@ function echo_numeric() (
# exit status: 0, it was ignored due to || :
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

local had_an_invalid_input=no
function on_input {
if is-number "$1"; then
if is-number -- "$1"; then
print_line "$1"
else
echo-style --error="[$1] is not a number" >/dev/stderr
Expand Down
66 changes: 0 additions & 66 deletions commands.beta/echo-on-empty-stdin

This file was deleted.

3 changes: 3 additions & 0 deletions commands.beta/echo-sort
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ function echo_sort() (
1.1
1.2
EOF
if test "$#" -ne 0; then
echo-error "$@"
fi
return 22 # EINVAL 22 Invalid argument
}

Expand Down
Loading

0 comments on commit 85075d3

Please sign in to comment.