Skip to content

Comprehensive dotfiles review and modernization#36

Merged
Defilan merged 6 commits intomainfrom
fix/dotfiles-review-cleanup
Feb 16, 2026
Merged

Comprehensive dotfiles review and modernization#36
Defilan merged 6 commits intomainfrom
fix/dotfiles-review-cleanup

Conversation

@Defilan
Copy link
Owner

@Defilan Defilan commented Feb 13, 2026

Summary

  • Ansible overhaul: Fixed 6 critical issues (broken ansible.cfg, env var case mismatch, non-existent Go version, hardcoded architecture, non-idempotent tasks), 12 important issues (FQCN, deprecated modules, broken test playbook, unsafe templates), and 15 suggestions (task splitting, tags, DRY package lists, documentation)
  • Shell/ZSH fixes: Apple Silicon compatibility for zsh plugin paths, Python 2->3, broken functions, missing quotes, master->main references, stale alias cleanup
  • Cleanup: Removed obsolete files (nginx configs with wrong user paths, JSCS/JSHint configs and hooks from 2016, duplicate vim plugins, .travis.yml, plug.vim.old)
  • CI pipeline expansion: From 1 job to 7 -- shell lint, ansible-lint, YAML lint, syntax check, Ansible dry-run on both Ubuntu and macOS with matrix strategy across config profiles, and ZSH syntax validation
  • Git hooks fix: Guard against unexpanded globs in hook runner so commits don't fail when no hook scripts exist

Closes #37

Test plan

  • Verify CI pipeline passes (shell-lint, ansible-lint, yaml-lint, syntax-check, dry-runs, zsh-syntax)
  • Run ansible-playbook defilan-osconfig/playbook.yml -e "config=lightweight" --check locally on macOS
  • Run ansible-playbook defilan-osconfig/playbook.yml -e "config=developer" --check locally on macOS
  • Confirm .zshrc.j2 renders correctly for lightweight config (no thefuck/kubectl lines)
  • Confirm .zshrc.j2 renders correctly for developer config (includes thefuck/kubectl)
  • Verify zsh plugin sourcing works on Apple Silicon (/opt/homebrew/share/ paths)
  • Verify commits work without --no-verify when no hook scripts exist

Ansible:
- Fix deprecated hostfile->inventory in ansible.cfg
- Fix env var case mismatch (config vs CONFIG) with safe fallback
- Fix non-existent Go version (1.25.0->1.23.6)
- Split tasks by OS into darwin.yml/debian.yml
- Use FQCN for all Ansible modules
- Make Go install idempotent with version check and ARM support
- Replace ignore_errors with smart failed_when on cask installs
- Use list-based name: instead of loop for package installs
- Add tags to all tasks for selective runs
- Fix test.yml referencing wrong role name (defilan-macos)
- Update min_ansible_version 2.1->2.14, add Debian/Ubuntu platforms
- Add Jinja2 conditionals in .zshrc.j2 for lightweight config
- Add requirements.yml, .ansible-lint config
- Replace boilerplate role README with actual documentation
- Remove obsolete .travis.yml
- Add real ansible-lint CI job alongside shell-lint

Shell/ZSH:
- Fix hardcoded /usr/local paths for Apple Silicon compatibility
- Fix Python 2 SimpleHTTPServer -> python3 http.server
- Fix ng-restart (was identical to ng-start)
- Fix broken give-credit() shell redirection bug
- Fix git-rename/g() missing quotes
- Update master->main in aliases and git config
- Make NVM/z sourcing safe with existence checks
- Remove stale aliases (Chef, iOS Simulator, Chrome)

Cleanup:
- Remove nginx/ directory (had someone else's paths)
- Remove obsolete jscsrc/jshintrc configs and git hooks
- Remove plug.vim.old backup
- Remove duplicate vim plugins (vim-json, vim-go, vim-mustache-handlebars)
- Fix duplicate shebang in link.sh
- Expand .gitignore with security-sensitive patterns
- Add YAML lint job for all Ansible YAML files
- Add Ansible syntax check (--syntax-check)
- Add Ansible dry-run on Ubuntu (check mode, lightweight + developer configs)
- Add Ansible dry-run on macOS (check mode, lightweight + developer configs)
- Add ZSH syntax validation for all .zsh files
- Install collection dependencies before ansible-lint
- Dry-run jobs depend on lint + syntax passing first
- Update README badge to match renamed workflow

CI now covers 7 jobs across macOS and Ubuntu runners,
testing both config profiles in check mode.
- Add play names to playbook.yml and tests/test.yml (name[play])
- Add trailing newline to playbook.yml (yaml[new-line-at-end-of-file])
- Add document start marker to meta/main.yml (document-start)
- Add version param to git tasks to fix no-changed-when
- Skip role-name rule in .ansible-lint (hyphen is intentional)
- Remove ansible.cfg from yamllint targets (INI format, not YAML)
- Add requirements.yml and tests/ to yamllint targets
- Pin ansible-lint action to full SHA (supply-chain security)
- Tighten Go tarball download to mode 0600 (owner-only)
- Tighten .zshrc template to mode 0600 (may contain sensitive config)
- Directory mode 0755 is intentional (needs execute for traversal)
Guard against unexpanded globs by checking that each match is a regular
file and is executable before running it. Fixes #37.
Replace legacy top-level fact variables (ansible_os_family,
ansible_architecture) with ansible_facts dictionary syntax to resolve
INJECT_FACTS_AS_VARS deprecation. Tighten directory mode from 0755 to
0750 to resolve SonarCloud security hotspot.
@sonarqubecloud
Copy link

@Defilan Defilan merged commit eceeb37 into main Feb 16, 2026
10 checks passed
@Defilan Defilan deleted the fix/dotfiles-review-cleanup branch February 16, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-commit hook fails when no hook scripts exist

1 participant