lint & format commands
authorShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 07:28:41 +0000 (02:28 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 17 Jan 2026 07:28:41 +0000 (02:28 -0500)
Makefile
completions/bash/git-remote-gcrypt
completions/fish/git-remote-gcrypt.fish
completions/templates/bash.in
completions/templates/zsh.in
completions/zsh/_git-remote-gcrypt

index e2a3b7cefba65a1380ee98dddf6b7e840cbabb87..0316c5de1c0ae465031fe2f17fa705010d2630b5 100644 (file)
--- 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)
index 5428873781e365709c65bbec491c754c2e8719ec..58e82c9964515b27b13c3ef96f9543a20d9c6ebb 100644 (file)
@@ -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
index 0bb8751cee541a123cce78ada5452b2566106eeb..bdb8d42f4aa392ba3d5d7be567a680245134e591 100644 (file)
@@ -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'
index a6b6985b5f9e8faee083cdbdc1df82dd14eed590..08d2aa50f7a5d436f1d18ecc3ae75a2467f65896 100644 (file)
@@ -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
index 0a44fe188a723be7754248bb43451c2c45bf9cf8..03b89776e4af46bc7cff557ac1a2eb21bf6e6d83 100644 (file)
@@ -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
 }
 
index d38d020d136b5e743521af6a130c059ec90d930a..7de0fd92736a5647659e0611adc86ebc84fd58ac 100644 (file)
@@ -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
 }