-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pre-commit: auto add table of contents with doctoc
#11679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
https://github.com/thlorenz/doctoc?tab=readme-ov-file#usage-as-a-git-hook https://github.com/thlorenz/doctoc/releases/tag/v2.2.0 Generates table of contents for Markdown files inside local git repository. Links are compatible with anchors generated by github or other sites. Added TOC to 3 Markdown files. Never have to create a TOC again just run: `pre-commit run doctoc --all-files` - CONTRIBUTING.md - INSTALL.md - README.md So both Apache Airflow and Apache Sedona use `doctoc`: https://github.com/apache/airflow/blob/eb4a8bc03c92d84e8238dcd76becb267ec8c3dd5/.pre-commit-config.yaml#L32 https://github.com/apache/sedona/blob/b0d86fda010e42f30b090aef1b2dbf06aa0a19d2/.pre-commit-config.yaml#L34
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11679 +/- ##
============================================
- Coverage 17.56% 17.56% -0.01%
+ Complexity 15539 15535 -4
============================================
Files 5911 5911
Lines 529359 529359
Branches 64655 64655
============================================
- Hits 92979 92958 -21
- Misses 425922 425944 +22
+ Partials 10458 10457 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds automatic table of contents (TOC) generation for Markdown files using the doctoc pre-commit hook. The change aims to keep documentation organized with automatically maintained TOCs that are compatible with GitHub anchor links.
- Added
doctocpre-commit hook configured to run on CONTRIBUTING.md, INSTALL.md, and README.md - Generated initial TOCs for the three target Markdown files with proper doctoc comment markers
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .pre-commit-config.yaml | Added doctoc hook configuration to auto-generate TOCs for specific Markdown files |
| README.md | Added auto-generated table of contents with doctoc markers |
| INSTALL.md | Added auto-generated table of contents with doctoc markers |
| CONTRIBUTING.md | Added auto-generated table of contents with doctoc markers |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
conflict label was removed but github still reports conflicts, Can you have a look @jbampton ? |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
914b326 to
0f00a69
Compare
* main: (1223 commits) Standardize and auto add license headers for SQL files with pre-commit (apache#12071) pre-commit use colored text in the CI for `pass / fail / skipped` (apache#11977) ui(locales): remove duplicates and fix typos (apache#11872) pre-commit: auto add table of contents with `doctoc` (apache#11679) chore: rename workflow `linter.yml` to `pre-commit.yml` (apache#11647) engine-schema: upgrade path for 4.23.0 (apache#12048) Fixes:apache#7837: Add isolationMethods and vlan to TrafficTypeResponse (apache#8151) Svgs (apache#12051) Update GUI Kubernetes logo (apache#11895) Keeping consistency with other error messages. (apache#11649) enhancement: add instance info as Libvirt metadata (apache#11061) Add empty Provider value in Network/VPC Offering form (apache#11982) merge fix Updating pom.xml version numbers for release 4.23.0.0-SNAPSHOT Updating pom.xml version numbers for release 4.22.1.0-SNAPSHOT UI: fix typo Upload SSL certificate (apache#11869) api/test: fix storage pool update with only id (apache#11897) Updating pom.xml version numbers for release 4.22.0.0 Handle null mountTimeout in RestoreBackupCommand (apache#11944) Fix the config 'powerflex.connect.on.demand' description (apache#11926) ...
https://github.com/thlorenz/doctoc?tab=readme-ov-file#usage-as-a-git-hook
https://github.com/thlorenz/doctoc/releases/tag/v2.2.0
Generates table of contents for Markdown files inside local git repository.
Links are compatible with anchors generated by github or other sites.
Added TOC to 3 Markdown files.
Never have to create a TOC again just run:
pre-commit run doctoc --all-filesSo both Apache Airflow and Apache Sedona use
doctoc:https://github.com/apache/airflow/blob/eb4a8bc03c92d84e8238dcd76becb267ec8c3dd5/.pre-commit-config.yaml#L32
https://github.com/apache/sedona/blob/b0d86fda010e42f30b090aef1b2dbf06aa0a19d2/.pre-commit-config.yaml#L34
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?