Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update variable and function names #5

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ trim_trailing_whitespace = true
insert_final_newline = false
trim_trailing_whitespace = false

[*.{sh,bash,zsh,fish}]
[*.{sh,bash,zsh,fish,lzui}]
indent_style = space
indent_size = 2
tab_width = 2

[zui-*]
indent_style = space
indent_size = 2
tab_width = 2
Expand Down Expand Up @@ -60,4 +65,4 @@ max_line_length = 120

[CHANGELOG.md]
indent_style = tab
indent_size = 4
indent_size = 4
77 changes: 77 additions & 0 deletions .github/.cspell/project-ignored.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
actlen
addwin
altmark
assgn
autoload
bindkey
bools
BTAB
builtins
cidx
circpath
colorpair
curx
cvar
datetime
delwin
dirpath
elems
ganchor
ganchors
hidx
hpfx
iidx
isset
lanchors
lbox
linerev
lineund
lzui
midx
nmap
nohyp
NONSELECTABLE
nonselectables
obal
regen
Regen
runtimes
SBUFFER
segs
sidx
SIDX
skeys
slist
stalog
stdlib
stext
strftime
syslib
tfield
THEWORD
timestr
trivy
trufflehog
unfunction
usetty
utillib
varname
xpos
ypos
zcurses
zgen
Zgen
zmodload
zstat
zstyle
zuiaction
zuianchor
zuianchoraglobal
zuicheckbox
zuieanchor
zuiel
zuiiaction
zuilbox
ZUILIST
zuilog
zuitfield
10 changes: 10 additions & 0 deletions .github/.cspell/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EPOCHSECONDS
FPATH
mbegin
PMSPEC
setopt
subshell
unsetopt
zcompile
Zshell
ZSTYLES
53 changes: 53 additions & 0 deletions .github/workflows/check_zsh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: "✅ Zsh"
on:
push:
branches: [main]
tags: ["v*.*.*"]
paths:
- "*.zsh"
- "*.lzui"
- "functions/*"
pull_request:
paths:
- "*.zsh"
- "*.lzui"
- "functions/*"
workflow_dispatch: {}

jobs:
zsh-matrix:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.set-matrix.outputs.files }}
steps:
- name: "⤵️ Check out code from GitHub"
uses: actions/checkout@v4
- name: "Set matrix output"
id: set-matrix
run: |
MATRIX="$(find . -type d -name 'doc' -prune -o -type f \( -iname '*.zsh' -o -iname '*.lzui' -o -iname 'zui-*' -o -iname '-zui-*' \) -print | jq -ncR '{"include": [{"file": inputs}]}')"
echo "files=${MATRIX}" >> $GITHUB_OUTPUT

zsh-n:
runs-on: ubuntu-latest
needs: zsh-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.zsh-matrix.outputs.output1) }}
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4
- name: "⚡ Install dependencies"
run: sudo apt update && sudo apt-get install -yq zsh
- name: "⚡ zsh -n: ${{ matrix.file }}"
env:
ZSH_FILE: ${{ matrix.file }}
run: |
zsh -n "${ZSH_FILE}"
- name: "⚡ zcompile ${{ matrix.file }}"
env:
ZSH_FILE: ${{ matrix.file }}
run: |
zsh -fc "zcompile ${ZSH_FILE}"; rc=$?
ls -al "${ZSH_FILE}.zwc"; exit "$rc"
2 changes: 2 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: 📖 Doxygen

on:
push:
branches: [main]
paths:
- "functions/**"
- "lib/**"
pull_request:
branches: [main]
paths:
- "functions/**"
- "lib/**"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "♻️ Sync Labels"
name: ♻️ Sync Labels

on:
schedule:
Expand All @@ -8,5 +8,5 @@ on:

jobs:
labels:
name: "♻️ Sync labels"
name: ♻️ Sync labels
uses: z-shell/.github/.github/workflows/sync-labels.yml@main
13 changes: 2 additions & 11 deletions .github/workflows/trunk_check.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
---
name: "⭕ Trunk"
name: ⭕ Trunk
on:
push:
branches: [main]
tags: ["v*.*.*"]
pull_request:
types: [opened, synchronize]
schedule:
- cron: "0 07 * * 5"
workflow_dispatch: {}

jobs:
check:
if: github.event.schedule != '0 07 * * 5'
name: "⚡"
name: ⚡
uses: z-shell/.github/.github/workflows/trunk.yml@main
upload:
if: github.event.schedule == '0 07 * * 5'
name: "🆙"
uses: z-shell/.github/.github/workflows/trunk.yml@main
secrets:
trunk-token: ${{ secrets.TRUNK_TOKEN }}
10 changes: 0 additions & 10 deletions .markdownlint.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
File renamed without changes.
10 changes: 10 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
45 changes: 30 additions & 15 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 0.12.1-beta
repo:
repo:
host: github.com
owner: z-shell
name: zui
version: 1.18.1
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.4.1
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtime - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
disabled:
- checkov
- yamllint
- trivy
- trufflehog
enabled:
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
actions:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
linters:
- name: markdownlint
command: [markdownlint, -q, --config, .github/.markdownlint.yaml, "${target}"]
direct_configs: [.github/.markdownlint.yaml]
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available
10 changes: 9 additions & 1 deletion demos/zui-demo-anchors
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
#
# ZUI demo: anchors
#
# Started from Zle or from command line
#
# Shows all types of anchors: external/regenerating, internal,
# internal/regenerating, pointing outside own module

-zui_std_cleanup deserialize:"zui-demo-anchors"
-zui_std_init app:"zui-demo-anchors" app_name:"ZUI Anchors"
emulate -LR zsh -o extendedglob -o typesetsilent -o warncreateglobal

builtin emulate -LR zsh
builtin setopt extended_glob typeset_silent warn_create_global

-zui_std_init2 # after emulate -LR

-zui_std_store_default_app_config b:border 1
Expand Down
42 changes: 25 additions & 17 deletions demos/zui-demo-append
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
#
# ZUI demo: append
#
# Started from Zle or from command line
#
# A demo showing how to add module instances to already generated document

-zui_std_cleanup deserialize:"zui-demo-append"
-zui_std_init app:"zui-demo-append" app_name:"ZUI On-The-Fly Append"
emulate -LR zsh -o extendedglob -o typesetsilent -o warncreateglobal

builtin emulate -LR zsh
builtin setopt extended_glob typeset_silent warn_create_global

-zui_std_init2 # after emulate -LR

-zui_std_store_default_app_config b:border 1
Expand All @@ -13,22 +21,22 @@ emulate -LR zsh -o extendedglob -o typesetsilent -o warncreateglobal

# Generator for module 1
demo_generator_A() {
local mod="$1" ice="$2"

# Anchor only in last instance
-zui_std_get_mod_factor "$mod"
if [[ "$ice" = "$REPLY" ]]; then
# 1+2 - from 1st line of this module, jump 2 beyond this module
# Regenerate $mod/$ice, and $mod/$ice+1, first running handler
local -a output
-zui_std_anchor "append_next" "1+2" "" ",mod${mod}_ice${ice},mod${mod}_ice$(( ice + 1 ))," "" "${ZUI[MAGENTA]}Append next!${ZUI[FMT_END]}" "-zui_std_set_mod_factor $mod $(( REPLY + 1 ))" output
fi

# Content
reply=( "This is module $mod, instance $ice" ${output[1]} )

# Non-selectable lines Hops to jump with [ and ] Local anchors (if output[1] not empty ...)
reply2=( 1 ) reply3=( 1 ) reply4=( ${output[1]:+append_next} )
local mod="$1" ice="$2"

# Anchor only in last instance
-zui_std_get_mod_factor "$mod"
if [[ "$ice" = "$REPLY" ]]; then
# 1+2 - from 1st line of this module, jump 2 beyond this module
# Regenerate $mod/$ice, and $mod/$ice+1, first running handler
local -a output
-zui_std_anchor "append_next" "1+2" "" ",mod${mod}_ice${ice},mod${mod}_ice$(( ice + 1 ))," "" "${ZUI[MAGENTA]}Append next!${ZUI[FMT_END]}" "-zui_std_set_mod_factor $mod $(( REPLY + 1 ))" output
fi

# Content
reply=( "This is module $mod, instance $ice" ${output[1]} )

# Non-selectable lines Hops to jump with [ and ] Local anchors (if output[1] not empty ...)
reply2=( 1 ) reply3=( 1 ) reply4=( ${output[1]:+append_next} )
}

## Start application ##
Expand Down
Loading