diff --git a/.dockerignore b/.dockerignore index 343ec13..6b9a21e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,10 @@ -# Git +# Git (keep .gitignore for tests) .git/ -.gitignore .github/ +# DevContainer (not needed for tests, uses JSONC format) +.devcontainer/ + # Documentation (not needed for tests) *.md !README.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2ae5af..36bf60b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,7 @@ jobs: - name: Validate JSON files run: | echo "Validating JSON files..." - find . -name "*.json" ! -path "./.git/*" ! -path "./node_modules/*" | while read -r file; do + find . -name "*.json" ! -path "./.git/*" ! -path "./node_modules/*" ! -path "*/.devcontainer/*" ! -path "*/tmux/plugins/*" | while read -r file; do echo "Checking $file" jq empty "$file" || exit 1 done diff --git a/tests/test-configs.sh b/tests/test-configs.sh index 3ee6883..1d302bb 100755 --- a/tests/test-configs.sh +++ b/tests/test-configs.sh @@ -131,11 +131,16 @@ fi # Test: No backup files in repo (should be gitignored) test_start "no backup files tracked in git" -backup_files=$(git -C "$REPO_ROOT" ls-files | grep -E '\.(bak|backup|old|swp|tmp)$' || true) -if [[ -z "$backup_files" ]]; then - test_pass +if [[ -d "$REPO_ROOT/.git" ]]; then + backup_files=$(git -C "$REPO_ROOT" ls-files | grep -E '\.(bak|backup|old|swp|tmp)$' || true) + if [[ -z "$backup_files" ]]; then + test_pass + else + test_fail "Found backup files in git: $backup_files" + fi else - test_fail "Found backup files in git: $backup_files" + # Skip test if not a git repository (e.g., in Docker) + skip_test "Not a git repository" fi # Test: .gitignore exists and has content