Skip to content

Fix multi-line parameter description indentation in README generation#285

Merged
swissspidy merged 2 commits intomainfrom
copilot/fix-multi-line-indent-issue
Mar 19, 2026
Merged

Fix multi-line parameter description indentation in README generation#285
swissspidy merged 2 commits intomainfrom
copilot/fix-multi-line-indent-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

Multi-paragraph parameter descriptions render with broken indentation in generated READMEs: continuation paragraphs with 0 leading spaces are dropped entirely from the description block, while those with 1–2 leading spaces carry those spaces through into the output.

Two root causes:

  • Regex terminator too broad (src/ScaffoldPackageCommand.php): The pattern \n\n(?=\S) ended a parameter description at any blank line followed by non-whitespace — including the start of a continuation paragraph written with no leading indent. Changed to \n\n(?=[^\n]+\n: |\*\*), which only terminates at the next parameter definition or section header.

  • Leading whitespace not stripped (rewrap_param_desc): Continuation paragraphs with alignment spaces (e.g. * Note:) had those spaces prepended verbatim before the \t\t indent. Added normalize_desc_indentation() which strips the per-paragraph minimum indentation while preserving relative indentation within each paragraph (so ---/options: blocks and inline code alignment are unaffected).

/**
 * [--extra]
 * : Show extended version information.
 *
 * Note: these three forms now all produce identical \t\t-indented output:
 *
 * Note: zero leading spaces          (was: dropped entirely)
 *  Note: one leading space           (was: \t\t + 1 extra space)
 *   Note: two leading spaces         (was: \t\t + 2 extra spaces)
 */

Added Behat scenarios explicitly covering the 0-space and 1-space continuation cases, and tightened the existing 2-space scenario to assert the exact \t\t prefix with no extra whitespace.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Behat/Behat/zipball/51bdf81639a14645c5d2c06926f4aa37d204921b
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/Behat/Gherkin/zipball/e26037937dfd48528746764dd870bc5d0836665f
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b1ceece8de0b337f79f28fbfb56a7d62e5812762
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/134921bfca9b02d8f374c48381451da1d98402f9
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/7adfefd530aa2d7570ba87100a99e2483a543b88
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Console-Highlighter/zipball/5b4803384d3303cf8e84141039ef56c8a123138d
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f12220f303e0d7c0844c0e5e957b0c3cee48d2f7
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a004701b11273a26cd7955a61d67a7f1e525a45a
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/6b5571001a7f04fa0422254c30a0017ec2f2cacc
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6ab598e1bc106e6827fd346ae4a12b4a5d634c32
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/1aba28b697c1e3b6bbec8a1725f8b11b6d3e5a5f
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/1279e1ce86ba768f0780c9d889852b4e02ff40d0
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/90f41072d220e5c40df6e8635f5dafba2d9d4d04
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a7de5df2e094f9a80b40a522391a7e6022df5f6
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/7b8842c2d8e85d0c3a5831236bf5869af6ab2a11
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/016951ae10980765e4e7aee491eb288c64e505b7
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/ef1377171613d09edd25b7816f05be8313f9115d
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b015312f28dd75b75d3422ca37dff2cd1a565e8d
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/47283cfd98d553edcb1353591f4e255dc1bb61f0
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/e549163b9760b8f71f191651d22acf32d56d6d4d
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/slevomat/coding-standard/zipball/1dd80bf3b93692bedb21a6623c496887fad05fec
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/swissspidy/phpstan-no-private/zipball/559cb0e8d092df7314ed4254db83db0427440af2
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/config/zipball/6c17162555bfb58957a55bb0e43e00035b6ae3d5
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/console/zipball/e1e6770440fb9c9b0cf725f81d1361ad1835329d
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/dependency-injection/zipball/0f651e58f4917fb0e2cd261ccbfe3d71e6e0f5db
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/event-dispatcher/zipball/dc2c0eba1af673e736bb851d747d266108aea746
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/filesystem/zipball/7bf9162d7a0dff98d079b72948508fa48018a770
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/string/zipball/6c9e1108041b5dce21a9a4984b531c4923aa9ec4
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/translation-contracts/zipball/65a8bc82080447fae78373aa10f8d13b38338977
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/translation/zipball/1888cf064399868af3784b9e043240f1d89d25ce
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/var-exporter/zipball/7345f46c251f2eb27c7b3ebdb5bb076b3ffcae04
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/symfony/yaml/zipball/58751048de17bae71c5aa0d13cb19d79bca26391
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/aa722f037b2d034828cd6c55ebe9e5c74961927e
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/config-command/zipball/71aaf21f67053e345f9c1e831b44407f7f356877
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/core-command/zipball/eef5fff75f885d3af854ff92ccca154838aae87a
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/eval-command/zipball/cbe69165a54702735061bf43c8e18fdd2b814b06
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/php-cli-tools/zipball/9cbf9946ebe3462005b642de69ccd65753981517
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/spyc/zipball/30f25baaaba939caaff1f4b8c7ed998632f59fe2
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/wp-cli-tests/zipball/67c51a8cfdfa9d26f4a1237d839ae9fee536968f
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/wp-cli/zipball/c5e537fe3ce9907f3397c43e05957090cdce00b4
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)
  • https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/b0fda07aac51317404f5e56dc8953ea899bc7bce
    • Triggering command: /usr/bin/php php /usr/bin/composer install -d foo -multi-line-indent-issue ageCommand.php k/scaffold-package-command/scaffold-package-command/vendor/bin/sh (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Multi-line descriptions not correctly indented</issue_title>
<issue_description>Noticed this at https://github.com/wp-cli/entity-command/ where the <file> arg was documented like this:

	 * [<file>]
	 * : Read post content from <file>. If this value is present, the
	 *     `--post_content` argument will be ignored.
	 *
	 *   Passing `-` as the filename will cause post content to
	 *   be read from STDIN.

In the handbook this looks OK:

Image

But in the readme generation the indentation is off:

Image

That's because everything is indented with tabs, but this new paragraph is indented with spaces:


	[<file>]
		Read post content from <file>. If this value is present, the
		    `--post_content` argument will be ignored.

  Passing `-` as the filename will cause post content to
  be read from STDIN.

Or as a screenshot:

Image</issue_description>

<agent_instructions>Make a follow-up change to #282 to address this inconsistent indentation</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@swissspidy Still not working correctly, despite #282.

With something like this, the second paragraph is not indented at all:

	 * ## OPTIONS
	 *
	 * [--extra]
	 * : Show extended version information.
	 *
	 * Note: to retrieve the database revision for an individual subsite in a Multisite installation,
	 * use `wp option get db_version --url=<subsite>`.

And when I add a leading space to the second paragraph, it will have 1 more space in the readme than the first, so off by one:

	 * ## OPTIONS
	 *
	 * [--extra]
	 * : Show extended version information.
	 *
	 *  Note: to retrieve the database revision for an individual subsite in a Multisite installation,
	 *  use `wp option get db_version --url=<subsite>`.
	 *

And if I add two leading spaces, it looks nicely aligned in PHPDoc but it will be off by two in the readme:

	 * [--extra]
	 * : Show extended version information.
	 *
	 *   Note: to retrieve the database revision for an individual subsite in a Multisite installation,
	 *   use `wp option get db_version --url=<subsite>`.

I think all 3 options should get the same, correct alignment in the readme.

Of course don't wanna break ## EXAMPLES with its 4 spaces indention, so they should continue to work as is.

	 * ## EXAMPLES
	 *
	 *     # Update WordPress
	 *     $ wp core update
	 *     Updating to version 4.5.2 (en_US)...
	 *     Downloading update from https://downloads.wordpress.org/release/wordpress-4.5.2-no-content.zip...
	 *     Unpacking the update...
	 *     Cleaning up files...
	 *     No old files were removed.
	 *     Success: WordPress updated successfully.

Same for options:

	* [--format=<format>]
	 * : Render output in a particular format.
	 * ---
	 * options:
	 *   - table
	 *   - csv
	 *   - json
	 * ---
```</body></comment_new>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix multi-line descriptions not correctly indented Fix multi-line parameter description indentation in README generation Mar 19, 2026
Copilot AI requested a review from swissspidy March 19, 2026 09:37
@swissspidy swissspidy marked this pull request as ready for review March 19, 2026 10:10
@swissspidy swissspidy requested a review from a team as a code owner March 19, 2026 10:10
Copilot AI review requested due to automatic review settings March 19, 2026 10:10
@swissspidy swissspidy added this to the 2.2.3 milestone Mar 19, 2026
@swissspidy swissspidy merged commit 0db836a into main Mar 19, 2026
63 of 64 checks passed
@swissspidy swissspidy deleted the copilot/fix-multi-line-indent-issue branch March 19, 2026 10:10
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 fixes README generation for WP-CLI command docs where option/argument descriptions span multiple paragraphs, ensuring continuation paragraphs are neither dropped nor rendered with inconsistent extra leading spaces.

Changes:

  • Tightens the definition-list regex terminator so multi-paragraph parameter descriptions are captured as a single block until the next parameter or section header.
  • Normalizes per-paragraph indentation in parameter descriptions before applying the standard \t\t indent, eliminating stray leading spaces.
  • Adds/updates Behat scenarios to cover zero- and one-leading-space continuation paragraphs and to assert exact \t\t-prefixed output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/ScaffoldPackageCommand.php Refines definition-list parsing and adds indentation normalization for multi-paragraph parameter descriptions during README generation.
features/scaffold-package-readme.feature Extends Behat coverage to validate correct indentation for continuation paragraphs with 0 and 1 leading spaces (and tightens an existing assertion).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-line descriptions not correctly indented

3 participants