pallets / pallets/click

[Feature] Add Custom Formatter System

Open
#561 3 comments 14 reactions 1 assignee View on GitHub

@davidism is already working on this.

Since Apr 12, 2021.

help output
Dominant language
Python
Stars
17.7k
Forks
2.3k
Avg merge
1d 30m
Merged PRs (30d)
18

Description

Right now there is just one way to format everything and it does not make everybody happy. Also it makes it hard for us to change it without potentially breaking things. So I propose the following:

  • add a context setting to override a formatter class
  • that formatter has attributes and methods to customize how things are emitted
  • we have two classes for this: a default formatter that we keep improving and a legacy formatter that is as it looked like in click 5 which is super stable if you need a stable target

Things this would be used for:

  • usage rendering
  • wrapping of text
  • colorization flags
  • maximum width / minimum width of help output
  • indentation style of help
  • default value rendering etc.
  • error messages

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.