]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
tidy makefile, gen_docs.py
authorShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 22:32:22 +0000 (17:32 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 22:36:22 +0000 (17:36 -0500)
Makefile
completions/gen_docs.py

index 79f42ba4c47e23f96e13f75349dc39bd69d41c72..50fbae5ed8e58e9e5538067994117963e9fcd2dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,10 +20,6 @@ _help:
                        print ""; \
                }' $(MAKEFILE_LIST)
 
-.PHONY: _all
-_all: lint test/installer test/system
-       @$(call print_success,All checks passed!)
-
 .PHONY: vars
 vars:  ##H Display all Makefile variables (simple)
        $(info === Makefile Variables (file/command/line origin) ===)
@@ -33,6 +29,7 @@ vars: ##H Display all Makefile variables (simple)
                ) \
        )
 
+
 define print_err
 printf "\033[1;31m%s\033[0m\n" "$(1)"
 endef
@@ -86,6 +83,7 @@ lint: ##H Run shellcheck
        -ruff check $(LINT_LOCS_PY)
        @$(call print_success,OK.)
 
+
 # --- Test Config ---
 PWD := $(shell pwd)
 COV_ROOT    := $(PWD)/.coverage
@@ -109,7 +107,7 @@ test/installer: check/deps  ##H Test installer logic
 
 
 .PHONY: test/purity
-test/purity: check/deps        ##H Run logic tests with native shell (As Shipped Integrity Check)
+test/purity: check/deps        ##H Run logic tests (with native /bin/sh)
        @echo "running system tests (native /bin/sh)..."
        @export GPG_TTY=$$(tty); \
         [ -n "$(DEBUG)$(V)" ] && export GCRYPT_DEBUG=1; \
@@ -119,7 +117,7 @@ test/purity: check/deps     ##H Run logic tests with native shell (As Shipped Integr
         done
 
 .PHONY: test/system
-test/system: check/deps        ##H Run coverage tests (Dynamic Bash)
+test/system: check/deps        ##H Run logic tests (with bash & coverage)
        @echo "running system tests (coverage/bash)..."
        @rm -rf $(COV_SYSTEM)
        @mkdir -p $(COV_SYSTEM)
@@ -153,6 +151,7 @@ CHECK_COVERAGE = $(if $(call find_coverage_xml,$(1)), \
        echo "Error: No coverage report found for $(2) in $(1)" ; \
        exit 1)
 
+
 .PHONY: test/cov _test_cov_internal
 test/cov:      ##H Show coverage gaps
        $(MAKE) _test_cov_internal
@@ -164,9 +163,18 @@ _test_cov_internal:
        exit $$err
 
 
+
 # Version from git describe (or fallback)
 __VERSION__ := $(shell git describe --tags --always --dirty 2>/dev/null || echo "@@DEV_VERSION@@")
 
+
+.PHONY: generate
+generate:      ##H Autogen man docs & shell completions
+       @$(call print_info,Generating documentation and completions...)
+       python3 completions/gen_docs.py
+       @$(call print_success,Generated.)
+
+
 .PHONY: install/, install
 install/: install
 install:       ##H Install system-wide
@@ -179,10 +187,12 @@ install:  ##H Install system-wide
 install/user:  ##H make install prefix=~/.local
        $(MAKE) install prefix=~/.local
 
+
 .PHONY: check/install
 check/install: ##H Verify installation works
        bash ./tests/verify-system-install.sh
 
+
 .PHONY: uninstall/, uninstall
 uninstall/: uninstall
 uninstall:     ##H Uninstall
@@ -199,10 +209,3 @@ uninstall/user:    ##H make uninstall prefix=~/.local
 .PHONY: clean
 clean: ##H Clean up
        rm -rf .coverage .build_tmp
-
-# --- Autogeneration ---
-.PHONY: generate
-generate:      ##H Autogenerate README usage & completions
-       @$(call print_info,Generating documentation and completions...)
-       python3 completions/gen_docs.py
-       @$(call print_success,Generated.)
index bc46bce2b35fffb12d5771934d412533c321c5d2..217a731256abbe0946240c3f4ef7c96c180a32d3 100755 (executable)
@@ -43,7 +43,7 @@ def update_readme(path, template_path):
     if not os.path.exists(template_path):
         print(f"Error: Template not found at {template_path}", file=sys.stderr)
         sys.exit(1)
-        
+
     with open(template_path, "r") as f:
         template_content = f.read()
 
@@ -64,39 +64,39 @@ def update_readme(path, template_path):
 
 def update_bash_completion(path, template_path, commands):
     os.makedirs(os.path.dirname(path), exist_ok=True)
-    
+
     with open(template_path, "r") as f:
         template = f.read()
-        
+
     cmd_str = " ".join(commands)
     content = template.replace("{commands}", cmd_str)
-    
+
     with open(path, "w") as f:
         f.write(content)
 
 
 def update_zsh_completion(path, template_path, commands):
     os.makedirs(os.path.dirname(path), exist_ok=True)
-    
+
     with open(template_path, "r") as f:
         template = f.read()
-        
+
     cmd_str = " ".join(commands)
     content = template.replace("{commands}", cmd_str)
-    
+
     with open(path, "w") as f:
         f.write(content)
 
 
 def update_fish_completion(path, template_path, commands):
     os.makedirs(os.path.dirname(path), exist_ok=True)
-    
+
     with open(template_path, "r") as f:
         template = f.read()
-        
+
     cmd_str = " ".join(commands)
     content = template.replace("{not_sc_list}", cmd_str)
-    
+
     with open(path, "w") as f:
         f.write(content)
 
@@ -116,7 +116,7 @@ def main():
     )
 
     print(f"Detected commands: {' '.join(comp_commands)}")
-    
+
     # Bash
     bash_path = os.path.join(root_dir, "completions/bash/git-remote-gcrypt")
     bash_tmpl = os.path.join(templates_dir, "bash.in")
@@ -134,7 +134,7 @@ def main():
     fish_tmpl = os.path.join(templates_dir, "fish.in")
     print(f"Updating Fish completions at: {fish_path}")
     update_fish_completion(fish_path, fish_tmpl, comp_commands)
-    
+
     readme_path = os.path.join(root_dir, "README.rst")
     readme_tmpl = os.path.join(templates_dir, "README.rst.in")
     update_readme(readme_path, readme_tmpl)