Repository navigation
chore: ignore and exclude local-only directories from Git, Ruff, and Black - #125
Merged
Merged
Conversation
…Black `pt-snap focus` and `pt-snap import` write `.pt-snap/focus.json` into the current directory, so dogfooding from the repository root leaves an untracked config file with machine-specific absolute paths that `git add .` would commit. A local `tmp/` scratch directory has the same problem and, because neither Ruff nor Black excluded it, made the documented root-level `ruff check .` / `black --check .` fail on files that are not project source while `src tests benchmarks .github` were clean. Add `.pt-snap/` and `tmp/` to .gitignore and declare explicit `extend-exclude` entries for both tools (including the already-ignored `.tmp/` and `.worktrees/`) so the root-level commands behave the same as the scoped ones even when gitignore handling is disabled. Document the convention in AGENTS.md. Fixes #119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Two kinds of directories inevitably appear in a working checkout but were neither ignored by Git nor excluded from the linters:
.pt-snap/— written into the current directory bypt-snap focusandpt-snap import(default focus update). Dogfooding from the repository root leaves an untrackedfocus.jsoncontaining machine-specific absolute paths thatgit add .would commit.tmp/— local scratch. On a real checkout this held 60+ unrelated scripts, and because Ruff/Black had no exclusions the documented root-level commands failed on them (ruff check .→ 312 errors,black --check .→ 66 files) whilesrc tests benchmarks .githubwere completely clean.Changes:
.gitignore: add.pt-snap/(new "pt-snap runtime artifacts" section with a comment explaining where it comes from) andtmp/(existing scratch section).pyproject.toml:extend-excludefor both Ruff and Black covering.pt-snap,tmp, and the already-gitignored.tmp/.worktrees. Both tools honor.gitignoreby default, so the explicit list is defensive: it keepsruff check .stable under--no-respect-gitignoreand makes the convention visible in the config rather than implied by.gitignore.AGENTS.md: one paragraph under Development Commands documenting the convention.No Python source or test changes.
🔗 Related Issue
Fixes #119
🧪 Testing
Verified in the branch checkout after creating
.pt-snap/focus.json,tmp/bad.py,.tmp/bad.py, and.pt-snap/bad.py(each with deliberate lint errors):git status --short?? .pt-snap//?? tmp/ruff check .ruff check . --no-respect-gitignoreblack --check .tests/_lint_canary.pywithimport osruff check .mainruff check .reports thetmp/errorspytest tests/test_package.py tests/test_governance.py: 28 passed.pyproject.tomlparses withtomllib.✅ Checklist
Snapshot Runtime Provenance
Snapshot provenance decision: no-update
Snapshot provenance no-update reason: This PR changes only .gitignore, pyproject.toml tool configuration, and AGENTS.md; no files under src/pt_snap_cli/snapshot/ are touched.
📋 Additional Notes
CI's lint job runs the same
ruff check ./black --check .on a clean checkout, so its behavior is unchanged; the fix targets developer and agent checkouts that contain these local directories.