From c4bf0bfded96c86724f49c7cf3b2556c4a3f39e9 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 18 Sep 2025 21:54:38 +1000 Subject: [PATCH 1/2] pre-commit: auto add table of contents with `doctoc` 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 --- .pre-commit-config.yaml | 6 ++++++ CONTRIBUTING.md | 16 ++++++++++++++++ INSTALL.md | 18 +++++++++++++++--- README.md | 18 ++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46db709c3fef..714cdb0b25da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,12 @@ repos: hooks: - id: identity - id: check-hooks-apply + - repo: https://github.com/thlorenz/doctoc.git + rev: v2.2.0 + hooks: + - id: doctoc + name: Add TOC for Markdown files + files: ^CONTRIBUTING\.md$|^INSTALL\.md$|^README\.md$ - repo: https://github.com/gitleaks/gitleaks rev: v8.27.2 hooks: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17ff4badc97c..eaa1c6b23f33 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,22 @@ Contributing to Apache CloudStack (ACS) ======================================= + + + +- [Summary](#summary) +- [Bug fixes](#bug-fixes) +- [Developing new features](#developing-new-features) +- [PendingReleaseNotes file](#pendingreleasenotes-file) +- [Fork the code](#fork-the-code) +- [Making changes](#making-changes) +- [Rebase `feature_x` to include updates from `upstream/main`](#rebase-feature_x-to-include-updates-from-upstreammain) +- [Make a GitHub Pull Request to contribute your changes](#make-a-github-pull-request-to-contribute-your-changes) +- [Cleaning up after a successful pull request](#cleaning-up-after-a-successful-pull-request) +- [Release Principles](#release-principles) + + + Summary ------- This document covers how to contribute to the ACS project. ACS uses GitHub PRs to manage code contributions. diff --git a/INSTALL.md b/INSTALL.md index efb42678b0a3..1a21a7728f78 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,9 +7,21 @@ or the developer [wiki](https://cwiki.apache.org/confluence/display/CLOUDSTACK/H Apache CloudStack developers use various platforms for development, this guide was tested against a CentOS 7 x86_64 setup. -* [Setting up development environment](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Setting+up+CloudStack+Development+Environment) for Apache CloudStack. -* [Building](https://cwiki.apache.org/confluence/display/CLOUDSTACK/How+to+build+CloudStack) Apache CloudStack. -* [Appliance based development](https://github.com/rhtyd/monkeybox) + + + +- [Setting up Development Environment](#setting-up-development-environment) + - [Using jenv and/or pyenv for Version Management](#using-jenv-andor-pyenv-for-version-management) +- [Getting the Source Code](#getting-the-source-code) +- [Building](#building) +- [To bring up CloudStack UI](#to-bring-up-cloudstack-ui) +- [Building with non-redistributable plugins](#building-with-non-redistributable-plugins) +- [Packaging and Installation](#packaging-and-installation) + - [Debian/Ubuntu](#debianubuntu) + - [RHEL/CentOS](#rhelcentos) +- [Notes](#notes) + + ## Setting up Development Environment diff --git a/README.md b/README.md index 2403b20d652d..ced310f75c75 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,24 @@ [![Apache CloudStack](tools/logo/apache_cloudstack.png)](https://cloudstack.apache.org/) + + + +- [Who Uses CloudStack?](#who-uses-cloudstack) +- [Demo](#demo) +- [Getting Started](#getting-started) +- [Getting Source Repository](#getting-source-repository) +- [Documentation](#documentation) +- [News and Events](#news-and-events) +- [Getting Involved and Contributing](#getting-involved-and-contributing) +- [Reporting Security Vulnerabilities](#reporting-security-vulnerabilities) +- [License](#license) +- [Notice of Cryptographic Software](#notice-of-cryptographic-software) +- [Star History](#star-history) +- [Contributors](#contributors) + + + Apache CloudStack is open source software designed to deploy and manage large networks of virtual machines, as a highly available, highly scalable Infrastructure as a Service (IaaS) cloud computing platform. CloudStack is used From 0f00a69634bf97e69e986e75841793d77b805da5 Mon Sep 17 00:00:00 2001 From: John Bampton Date: Thu, 13 Nov 2025 18:53:57 +1000 Subject: [PATCH 2/2] Fix up --- .pre-commit-config.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd1768f17690..4ff8e29f6262 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,6 +47,11 @@ repos: - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 hooks: + - id: chmod + name: set file permissions + args: ['644'] + files: \.md$ + stages: [manual] - id: insert-license name: add license for all Markdown files files: \.md$ @@ -123,14 +128,6 @@ repos: args: [--config=.github/linters/.markdown-lint.yml] types: [markdown] files: \.(md|mdown|markdown)$ - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.5 - hooks: - - id: chmod - name: set file permissions - args: ['644'] - files: \.md$ - stages: [manual] - repo: https://github.com/adrienverge/yamllint rev: v1.37.1 hooks: