chore: remove generated-config bloat and dead files (ponytail audit) - #76
chore: remove generated-config bloat and dead files (ponytail audit)#76maehr wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request streamlines the template repository by removing large, generator-produced Git config files and dead/duplicated maintenance files, while keeping the repo’s intended workflows (Quarto build + Zenodo-ready site archive + git-cliff changelog) intact.
Changes:
- Simplified
.gitignore/.gitattributesdown to the patterns needed for this repo’s actual toolchain outputs. - Simplified
scripts/release_site_archive.pyto useshutil.make_archivewhile preserving the--tag/--stageinterface used by npm scripts and GitHub Actions. - Removed redundant/dead files and updated references to point at
AGENTS.md(instead of the deleted.github/copilot-instructions.md).
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/conftest.py |
Removes an empty, unused pytest config file. |
scripts/release_site_archive.py |
Simplifies the site-zip creation logic using shutil.make_archive while keeping the release workflow interface. |
CONTRIBUTING.md |
Updates agent guidance link to AGENTS.md. |
CODE_OF_CONDUCT.md |
Normalizes list formatting and updates enforcement contact to an email address. |
cliff.toml |
Removes repo-history-specific commit parsers so downstream instances inherit fewer special cases. |
.prettierignore |
Stops excluding CODE_OF_CONDUCT.md so it stays formatted consistently. |
.gitignore |
Replaces a large generated ignore file with a focused set of entries for this repository’s toolchain. |
.github/workflows/changelog.yaml |
Deletes a CI workflow that generated/printed changelog output without persisting it. |
.github/template-site/agent-release-workflow.qmd |
Updates agent workflow docs to reference AGENTS.md. |
.github/copilot-instructions.md |
Removes redundant agent instructions now covered by AGENTS.md. |
.gitattributes |
Replaces exhaustive tables with * text=auto plus a focused list of binary patterns. |
📝 WalkthroughWalkthroughThis PR simplifies repository configuration files (.gitattributes, .gitignore, .prettierignore), updates CODE_OF_CONDUCT.md formatting and contact info, removes copilot-instructions.md and the changelog workflow in favor of AGENTS.md references, trims cliff.toml commit parsers, and rewrites the release archive script with fixed paths. ChangesRepository configuration and documentation cleanup
Copilot instructions to AGENTS.md migration
Changelog workflow removal and release script rewrite
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/release_site_archive.py`:
- Around line 45-56: The cleanup in release_site_archive.py is too broad because
it removes every site-*.zip from ARCHIVE_DIR, which can delete unrelated
committed release archives and stage those deletions when args.stage is set.
Update the archive cleanup logic around ARCHIVE_DIR.glob and shutil.make_archive
to delete only the current release’s site-{safe_tag}.zip before recreating it,
keeping all other existing ZIPs untouched.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d13bbd9b-df2a-4325-84a5-a641cfa583dd
📒 Files selected for processing (11)
.gitattributes.github/copilot-instructions.md.github/template-site/agent-release-workflow.qmd.github/workflows/changelog.yaml.gitignore.prettierignoreCODE_OF_CONDUCT.mdCONTRIBUTING.mdcliff.tomlscripts/release_site_archive.pytest/conftest.py
💤 Files with no reviewable changes (4)
- .github/copilot-instructions.md
- .github/workflows/changelog.yaml
- .prettierignore
- cliff.toml
| ARCHIVE_DIR.mkdir(exist_ok=True) | ||
| for old_archive in ARCHIVE_DIR.glob("site-*.zip"): | ||
| old_archive.unlink() | ||
| archive_path = shutil.make_archive( | ||
| str(ARCHIVE_DIR / f"site-{safe_tag}"), "zip", SITE_DIR | ||
| ) | ||
|
|
||
|
|
||
| def main() -> int: | ||
| args = parse_args() | ||
| site_dir = Path(args.site_dir).expanduser().resolve() | ||
| archive_dir = Path(args.archive_dir).expanduser().resolve() | ||
| safe_tag = sanitize_tag(args.tag or default_tag()) | ||
| archive_name = f"site-{safe_tag}.zip" | ||
| archive_path = archive_dir / archive_name | ||
|
|
||
| ensure_site_dir(site_dir) | ||
| remove_existing_archives(archive_dir, archive_name) | ||
| build_archive(site_dir, archive_path) | ||
|
|
||
| if args.stage: | ||
| stage_archive_dir(archive_dir) | ||
| subprocess.run( | ||
| ["git", "add", "-A", str(ARCHIVE_DIR)], cwd=REPO_ROOT, check=True | ||
| ) | ||
| print(f"Staged {ARCHIVE_DIR}") |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== release script ==\n'
cat -n scripts/release_site_archive.py
printf '\n== release artifact references ==\n'
rg -n "release-artifacts|site-v\\d|make_archive|stage" -S .
printf '\n== candidate guidance files ==\n'
fd -a -g 'AGENTS.md' -g 'README.md' -g 'CONTRIBUTING.md' -g 'docs/**' .Repository: maehr/open-research-data-template
Length of output: 3920
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== AGENTS release instructions ==\n'
sed -n '118,186p' AGENTS.md
printf '\n== release-artifacts contents ==\n'
find release-artifacts -maxdepth 1 -type f -name 'site-*.zip' -printf '%f\n' 2>/dev/null | sortRepository: maehr/open-research-data-template
Length of output: 5776
Limit cleanup to the current release archive
release_site_archive.py:45-56 deletes every site-*.zip in release-artifacts/, so a new release can remove previously committed release ZIPs and, with --stage, stage those deletions too. Remove only site-{safe_tag}.zip instead of purging the whole directory.
🧰 Tools
🪛 ast-grep (0.44.0)
[error] 52-54: Command coming from incoming request
Context: subprocess.run(
["git", "add", "-A", str(ARCHIVE_DIR)], cwd=REPO_ROOT, check=True
)
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
(subprocess-from-request)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/release_site_archive.py` around lines 45 - 56, The cleanup in
release_site_archive.py is too broad because it removes every site-*.zip from
ARCHIVE_DIR, which can delete unrelated committed release archives and stage
those deletions when args.stage is set. Update the archive cleanup logic around
ARCHIVE_DIR.glob and shutil.make_archive to delete only the current release’s
site-{safe_tag}.zip before recreating it, keeping all other existing ZIPs
untouched.
Summary
Repo-wide over-engineering audit: cuts generated config bloat, dead files, and hand-rolled stdlib. Net: −967 lines across 11 files, no behavior change for template users.
What changed
.gitignore493 → 33 lines: replaced the toptal-generated multi-OS/multi-editor file with entries for what this toolchain actually emits (Quarto, lychee, Node, uv/ruff/pytest/Jupyter, R,.env, OS junk). Removing the mega-ignore surfaced two stale local artifacts (.jampack/cache from a tool no longer referenced, emptybuild/) that were deleted rather than re-ignored..gitattributes365 → 22 lines:* text=autoplus explicit binary patterns covers every file in the tree; dropped the exhaustive generated Python/R extension tables (including the surprising*.csv eol=crlf).scripts/release_site_archive.py117 → 62 lines: zipping now usesshutil.make_archive; dropped the--site-dir/--archive-dirflags that no caller ever set. CLI stays compatible (--tag,--stage), sonpm run release:prepareandrelease.ymlare untouched. Smoke-tested: archive builds and unzips correctly..github/copilot-instructions.md: it restated AGENTS.md, and Copilot reads AGENTS.md natively now. References inCONTRIBUTING.mdand the template-site release-workflow page point atAGENTS.mdinstead..github/workflows/changelog.yaml: it generated CHANGELOG.md in CI, printed it, and threw it away — no commit, no artifact, no gate.npm run changelogcovers this locally.test/conftest.py:test/.gitkeepalready keeps the directory.cliff.toml: dropped commit parsers that only matched this repo's pre-1.0 history (^Devcontainer,^Branding,^Quarto, etc.) so project instances don't inherit them; the.* → Othercatch-all still handles stray commits. Verifiednpm run changelog:unreleasedstill renders.CODE_OF_CONDUCT.md: enforcement contact is now moritz.maehr@gmail.com (this repo's working CoC), whileCODE_OF_CONDUCT.template.mdkeeps the[INSERT CONTACT METHOD]placeholder for template users. Also removed the file from.prettierignore, which had let it drift from the template's formatting (*vs-list markers) — both are prettier-formatted now.Deliberately not touched
.qmdchunks in project instances; dropping them is a separate decision..templatefile pairs — that duplication is the template's design.Validation
npm run check,uv run ruff check,uv run ty checkall pass; prek pre-commit + commitlint hooks green on every commit.git-cliffconfig verified.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores