Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wp-cli/wp-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 71de10f
Choose a base ref
...
head repository: wp-cli/wp-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3da35a2
Choose a head ref
  • 18 commits
  • 5 files changed
  • 4 contributors

Commits on Feb 12, 2026

  1. Initial plan

    Copilot committed Feb 12, 2026
    Configuration menu
    Copy the full SHA
    335ad03 View commit details
    Browse the repository at this point in the history
  2. Implement extensible format system for WP-CLI Formatter

    - Add static $custom_formatters array to track custom format handlers
    - Add Formatter::add_format() method to register custom formatters
    - Add Formatter::get_available_formats() method with filterable format list
    - Update format() and show_multiple_fields() to support custom handlers
    - Add PHPUnit tests for custom format functionality
    - Add Behat feature tests for custom format scenarios
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Copilot and swissspidy committed Feb 12, 2026
    Configuration menu
    Copy the full SHA
    f4d1ea6 View commit details
    Browse the repository at this point in the history
  3. Add comprehensive documentation for extensible format system

    - Update Formatter class docblock to mention extensibility
    - Add detailed examples to add_format() method
    - Add usage examples to get_available_formats() method
    - Document filter hook 'formatter_available_formats'
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Copilot and swissspidy committed Feb 12, 2026
    Configuration menu
    Copy the full SHA
    d040c7d View commit details
    Browse the repository at this point in the history
  4. Address code review feedback

    - Add BUILTIN_FORMATS constant for better maintainability
    - Add debug message for skipped items in custom formatters
    - Improve test coverage for parameter passing and field filtering
    - Add type assertions to satisfy PHPStan
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Copilot and swissspidy committed Feb 12, 2026
    Configuration menu
    Copy the full SHA
    f95fe35 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2026

  1. Configuration menu
    Copy the full SHA
    9eba0ed View commit details
    Browse the repository at this point in the history
  2. Test fixes

    swissspidy committed Feb 19, 2026
    Configuration menu
    Copy the full SHA
    05e50d0 View commit details
    Browse the repository at this point in the history
  3. Fix test

    swissspidy committed Feb 19, 2026
    Configuration menu
    Copy the full SHA
    0831496 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2026

  1. Configuration menu
    Copy the full SHA
    7e4e752 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cc17fb5 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2026

  1. Configuration menu
    Copy the full SHA
    0e78e80 View commit details
    Browse the repository at this point in the history
  2. Update features/formatter.feature

    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    swissspidy and Copilot authored Mar 10, 2026
    Configuration menu
    Copy the full SHA
    95f5ab6 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2026

  1. Address code review feedback: allow overriding built-in formats and f…

    …ix field resolution for custom formatters
    
    - Fix handler signatures in tests to accept ($items, $fields) parameters
    - Remove restriction preventing override of built-in formats
    - Add field validation and prefix resolution for custom formatters
    - Check custom formatters before built-in switch statement to enable overriding
    - Add test for prefix field resolution with custom formatters
    - Add test for overriding built-in formats
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Copilot and swissspidy committed Mar 11, 2026
    Configuration menu
    Copy the full SHA
    a8f82fe View commit details
    Browse the repository at this point in the history
  2. Lint fixes

    swissspidy committed Mar 11, 2026
    Configuration menu
    Copy the full SHA
    fb25b5e View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2026

  1. Configuration menu
    Copy the full SHA
    760682a View commit details
    Browse the repository at this point in the history
  2. Convert built-in formats to use extensible format API

    - Add static flag to track built-in format registration
    - Create register_builtin_formats() method to register all built-in formats using add_format()
    - Register count, ids, json, yaml, csv, and table formats via the API
    - Remove switch statements from format() and show_multiple_fields() methods
    - All built-in formats now use the same registration mechanism as custom formats
    - Built-in formats can be overridden by calling add_format() with the same name
    - Special handling for ids/count formats (work with raw items) and table format (needs formatter instance)
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/e94ee5b4-3181-4bf6-b2d2-3ba9a27776c6
    Copilot and swissspidy committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    5e8b56b View commit details
    Browse the repository at this point in the history
  3. Refactor formatter initialization per code review feedback

    - Remove BUILTIN_FORMATS constant, use array_keys($custom_formatters) instead
    - Remove defensive type check for hook return value (trust the hook)
    - Create InitializeFormatter bootstrap step to register built-in formats
    - Move format registration from lazy initialization to bootstrap
    - Remove special handling for json/yaml in show_multiple_fields
    - Make register_builtin_formats() public and remove flag check
    - Add setUpBeforeClass to FormatterTest for test initialization
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/44e4d3bc-205c-4f5f-b5f4-892faf288cf9
    Copilot and swissspidy committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    f3df6c9 View commit details
    Browse the repository at this point in the history
  4. Restore WP_CLI::print_value() for json/yaml in single-item display

    Fixes test failures where single-item display was incorrectly wrapping
    items in an array. WP_CLI::print_value() properly handles single items
    by outputting them without array wrappers, which is required for json/yaml
    formats in single-item mode (display_item).
    
    Multi-item display continues to use registered format handlers directly.
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/747ee921-fbd9-4706-97a9-551bbfc7849b
    Copilot and swissspidy committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    83752cb View commit details
    Browse the repository at this point in the history
  5. Extend format handlers API to support single-item display

    - Add optional context parameter to json/yaml format handlers
    - Handlers check for 'single_item' flag to output without array wrapper
    - Remove WP_CLI::print_value() usage in show_multiple_fields
    - Pass context flag when calling formatters for single-item display
    - Maintains backward compatibility for custom format handlers
    
    Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
    Agent-Logs-Url: https://github.com/wp-cli/wp-cli/sessions/2e99076d-2ca2-4d77-a5a8-eb3b535c9c25
    Copilot and swissspidy committed Mar 23, 2026
    Configuration menu
    Copy the full SHA
    3da35a2 View commit details
    Browse the repository at this point in the history
Loading