Skip to content

Conversation

@jbampton
Copy link
Member

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

Description

This PR...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

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
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.56%. Comparing base (dc8f465) to head (0f00a69).
⚠️ Report is 2 commits behind head on main.

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     
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.62% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vishesh92 vishesh92 requested a review from Copilot October 13, 2025 10:48
Copy link
Contributor

Copilot AI left a 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 doctoc pre-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.

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@DaanHoogland
Copy link
Contributor

conflict label was removed but github still reports conflicts, Can you have a look @jbampton ?

@github-actions
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@jbampton jbampton force-pushed the pre-commit-add-doctoc branch from 914b326 to 0f00a69 Compare November 13, 2025 08:58
@DaanHoogland DaanHoogland merged commit a5b455f into apache:main Nov 13, 2025
28 checks passed
@jbampton jbampton deleted the pre-commit-add-doctoc branch November 13, 2025 10:16
ribafish added a commit to ribafish/apache-cloudstack that referenced this pull request Nov 14, 2025
* 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)
  ...
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.

3 participants