From 8a3c80702cd760afe388e6bea4a11bdea722f0dd Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Sat, 17 Jan 2026 02:28:41 -0500 Subject: [PATCH] lint & format commands --- Makefile | 4 ++-- completions/bash/git-remote-gcrypt | 32 ++++++++++++------------- completions/fish/git-remote-gcrypt.fish | 6 ++--- completions/templates/bash.in | 32 ++++++++++++------------- completions/templates/zsh.in | 24 +++++++++---------- completions/zsh/_git-remote-gcrypt | 24 +++++++++---------- 6 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Makefile b/Makefile index e2a3b7c..0316c5d 100644 --- a/Makefile +++ b/Makefile @@ -63,13 +63,13 @@ check/deps: ##H Verify kcov & shellcheck LINT_LOCS_PY ?= $(shell git ls-files '*.py') LINT_LOCS_SH ?= $(shell git ls-files '*.sh' ':!tests/system-test.sh') -FORMAT_LOCS_SH ?= completions/** +FORMAT_LOCS_SHELL ?= completions/*.sh completions/**/* .PHONY: format format: ##H Format scripts @$(call print_target,format) @$(call print_info,Formatting shell scripts...) - shfmt -ci -bn -s -w $(LINT_LOCS_SH) $(FORMAT_LOCS_SH) + shfmt -ci -bn -s -w $(LINT_LOCS_SH) $(FORMAT_LOCS_SHELL) @$(call print_success,OK.) @$(call print_info,Formatting Python scripts...) -black $(LINT_LOCS_PY) diff --git a/completions/bash/git-remote-gcrypt b/completions/bash/git-remote-gcrypt index 5428873..58e82c9 100644 --- a/completions/bash/git-remote-gcrypt +++ b/completions/bash/git-remote-gcrypt @@ -12,7 +12,7 @@ _git_remote_gcrypt() { # 1. First argument: complete commands and global options if [[ $COMP_CWORD -eq 1 ]]; then COMPREPLY=($(compgen -W "$commands $opts" -- "$cur")) - if [[ "$cur" == gcrypt::* ]]; then + if [[ $cur == gcrypt::* ]]; then COMPREPLY+=("$cur") fi return 0 @@ -20,24 +20,24 @@ _git_remote_gcrypt() { # 2. Handle subcommands case "${COMP_WORDS[1]}" in - clean) - local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :) - COMPREPLY=($(compgen -W "--force --init --hard $remotes" -- "$cur")) - return 0 - ;; - check | stat) - local remotes=$(git remote 2>/dev/null || :) - COMPREPLY=($(compgen -W "$remotes" -- "$cur")) - return 0 - ;; - capabilities | fetch | list | push) - COMPREPLY=($(compgen -W "-h --help" -- "$cur")) - return 0 - ;; + clean) + local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :) + COMPREPLY=($(compgen -W "--force --init --hard $remotes" -- "$cur")) + return 0 + ;; + check | stat) + local remotes=$(git remote 2>/dev/null || :) + COMPREPLY=($(compgen -W "$remotes" -- "$cur")) + return 0 + ;; + capabilities | fetch | list | push) + COMPREPLY=($(compgen -W "-h --help" -- "$cur")) + return 0 + ;; esac # 3. Fallback (global flags if not in a known subcommand?) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W "$opts" -- "$cur")) return 0 fi diff --git a/completions/fish/git-remote-gcrypt.fish b/completions/fish/git-remote-gcrypt.fish index 0bb8751..bdb8d42 100644 --- a/completions/fish/git-remote-gcrypt.fish +++ b/completions/fish/git-remote-gcrypt.fish @@ -13,6 +13,6 @@ complete -c git-remote-gcrypt -n "__fish_seen_subcommand_from check" -a "(git re complete -c git-remote-gcrypt -n "__fish_seen_subcommand_from stat" -a "(git remote 2>/dev/null)" -d 'Git Remote' # Clean flags -complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l force -d 'Flag'; -complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l init -d 'Flag'; -complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l hard -d 'Flag'; +complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l force -d 'Flag' +complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l init -d 'Flag' +complete -c git-remote-gcrypt -f -n "__fish_seen_subcommand_from clean" -l hard -d 'Flag' diff --git a/completions/templates/bash.in b/completions/templates/bash.in index a6b6985..08d2aa5 100644 --- a/completions/templates/bash.in +++ b/completions/templates/bash.in @@ -12,7 +12,7 @@ _git_remote_gcrypt() { # 1. First argument: complete commands and global options if [[ $COMP_CWORD -eq 1 ]]; then COMPREPLY=($(compgen -W "$commands $opts" -- "$cur")) - if [[ "$cur" == gcrypt::* ]]; then + if [[ $cur == gcrypt::* ]]; then COMPREPLY+=("$cur") fi return 0 @@ -20,24 +20,24 @@ _git_remote_gcrypt() { # 2. Handle subcommands case "${COMP_WORDS[1]}" in - clean) - local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :) - COMPREPLY=($(compgen -W "{clean_flags_bash} $remotes" -- "$cur")) - return 0 - ;; - check | stat) - local remotes=$(git remote 2>/dev/null || :) - COMPREPLY=($(compgen -W "$remotes" -- "$cur")) - return 0 - ;; - capabilities | fetch | list | push) - COMPREPLY=($(compgen -W "-h --help" -- "$cur")) - return 0 - ;; + clean) + local remotes=$(git remote -v 2>/dev/null | grep 'gcrypt::' | awk '{print $1}' | sort -u || :) + COMPREPLY=($(compgen -W "{clean_flags_bash} $remotes" -- "$cur")) + return 0 + ;; + check | stat) + local remotes=$(git remote 2>/dev/null || :) + COMPREPLY=($(compgen -W "$remotes" -- "$cur")) + return 0 + ;; + capabilities | fetch | list | push) + COMPREPLY=($(compgen -W "-h --help" -- "$cur")) + return 0 + ;; esac # 3. Fallback (global flags if not in a known subcommand?) - if [[ "$cur" == -* ]]; then + if [[ $cur == -* ]]; then COMPREPLY=($(compgen -W "$opts" -- "$cur")) return 0 fi diff --git a/completions/templates/zsh.in b/completions/templates/zsh.in index 0a44fe1..03b8977 100644 --- a/completions/templates/zsh.in +++ b/completions/templates/zsh.in @@ -13,18 +13,18 @@ _git_remote_gcrypt() { _arguments -s -S $args case $line[1] in - clean) - _arguments {clean_flags_zsh} \ - '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"' - ;; - check | stat) - _arguments \ - '*:gcrypt URL: _alternative "remotes:git remote:($(git remote 2>/dev/null))" "files:file:_files"' - ;; - *) - _arguments \ - '*:gcrypt URL:' - ;; + clean) + _arguments {clean_flags_zsh} \ + '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"' + ;; + check | stat) + _arguments \ + '*:gcrypt URL: _alternative "remotes:git remote:($(git remote 2>/dev/null))" "files:file:_files"' + ;; + *) + _arguments \ + '*:gcrypt URL:' + ;; esac } diff --git a/completions/zsh/_git-remote-gcrypt b/completions/zsh/_git-remote-gcrypt index d38d020..7de0fd9 100644 --- a/completions/zsh/_git-remote-gcrypt +++ b/completions/zsh/_git-remote-gcrypt @@ -13,18 +13,18 @@ _git_remote_gcrypt() { _arguments -s -S $args case $line[1] in - clean) - _arguments --force'[Flag]' --init'[Flag]' --hard'[Flag]' \ - '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"' - ;; - check | stat) - _arguments \ - '*:gcrypt URL: _alternative "remotes:git remote:($(git remote 2>/dev/null))" "files:file:_files"' - ;; - *) - _arguments \ - '*:gcrypt URL:' - ;; + clean) + _arguments --force'[Flag]' --init'[Flag]' --hard'[Flag]' \ + '*:gcrypt URL: _alternative "remotes:gcrypt remote:($(git remote -v 2>/dev/null | grep "gcrypt::" | awk "{print \$1}" | sort -u))" "files:file:_files"' + ;; + check | stat) + _arguments \ + '*:gcrypt URL: _alternative "remotes:git remote:($(git remote 2>/dev/null))" "files:file:_files"' + ;; + *) + _arguments \ + '*:gcrypt URL:' + ;; esac } -- 2.52.0