Skip to content

Collapse CodeWiki's generated docs files in pull requests - #18

Merged
dandydarshan merged 1 commit into
mainfrom
fix/collapse-generated-docs-files
Nov 7, 2026
Merged

dandydarshan merged 1 commit into
mainfrom
fix/collapse-generated-docs-files

Conversation

@dandydarshan

@dandydarshan dandydarshan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

In a real test PR, GitHub collapsed the graph (docs/temp/.gitattributes from #13) but still showed docs/metadata.json (112 lines) and docs/update_record.json (577 lines) in full, next to the pages reviewers actually want to read.

 create_documentation_metadata (every generate and --update)
   write docs/metadata.json
+  write docs/.gitattributes unless it exists:
+    /metadata.json /update_record.json /module_tree.json /first_module_tree.json
+    /search_index.json /index.html /validate_module_tree_ownership.py   linguist-generated=true
  • The .md pages stay visible.
  • Entries are anchored to the docs folder, so same-named files in subfolders aren't affected.
  • A user's own docs/.gitattributes is never overwritten.
  • git diff locally is unchanged; only GitHub's PR view collapses these files.

Evidence

  • The test PR on the throwaway repo: a 7-line file under docs/temp/ showed "Some generated files are not rendered by default", so GitHub honours linguist-generated from a nested .gitattributes. This PR uses the same mechanism one folder up.
  • test_generated_docs_files_collapse_in_pull_requests_but_pages_do_not, using git check-attr:
    docs/metadata.json, update_record.json, search_index.json, index.html → linguist-generated: true
    docs/overview.md                                                       → unspecified
    docs/sub/metadata.json                                                 → unspecified (anchored)
    existing docs/.gitattributes                                           → left as it was
    
  • 501 tests pass.

Merge Danger

Door: two-way

Blast Radius: PR rendering

This only affects how GitHub renders these files and how they count in language statistics. Content and merges are unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd

Base automatically changed from fix/serve-artifacts-and-ports to main November 7, 2026 01:43
@dandydarshan
dandydarshan force-pushed the fix/collapse-generated-docs-files branch 2 times, most recently from 971a83d to c2b701e Compare November 7, 2026 03:19
In a real PR, docs/metadata.json and docs/update_record.json showed 112
and 577 diff lines next to the pages. Generating now writes
docs/.gitattributes (unless one exists) marking CodeWiki's non-page files
linguist-generated: metadata, update record, module trees, search index,
index.html and the helper script. GitHub collapses them as it does the
graph under temp/; the .md pages stay visible for review. Entries are
anchored to the docs folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd
@dandydarshan
dandydarshan force-pushed the fix/collapse-generated-docs-files branch from c2b701e to 12f06bc Compare November 7, 2026 03:22
@dandydarshan
dandydarshan merged commit 0631834 into main Nov 7, 2026
10 checks passed
@dandydarshan
dandydarshan deleted the fix/collapse-generated-docs-files branch November 7, 2026 03:23
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.

1 participant