A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/google/pyink below:

google/pyink: Pyink, pronounced pī-ˈiŋk, is a Python formatter, forked from Black with a few different formatting behaviors.

Pyink, pronounced pī-ˈiŋk, is a Python formatter, forked from Black with a few different formatting behaviors. We intend to keep rebasing on top of Black's latest changes.

We would love to adopt Black, but adopting it overnight is too disruptive to the thousands of developers working in our monorepo. We also have other Python tooling that assumes certain formatting, it would be a too big task to update them all at once. We decided to maintain a few local patches to Black as a medium-term solution, and release them as a separate tool called Pyink.

Pyink is intended to be an adoption helper, and we wish to remove as many patches as possible in the future.

What are the main differences?

These are differences that existed in the past. We have upstreamed them to Black so they are now identical.

Same as black, except you'll use pyink. All black command line options are supported by pyink. To configure the options in the pyproject.toml file, you need to put them in the [tool.pyink] section instead of [tool.black].

There are also a few Pyink only options:

  --pyink / --no-pyink            Enable the Pyink formatting mode. Disabling
                                  it should behave the same as Black.
                                  [default: pyink]
  --pyink-indentation [2|4]       The number of spaces used for indentation.
                                  [default: 4]
  --pyink-use-majority-quotes     When normalizing string quotes, infer
                                  preferred quote style by calculating the
                                  majority in the file. Multi-line strings and
                                  docstrings are excluded from this as they
                                  always use double quotes.
Is there a VS Code extension for Pyink?

No, but with a bit workaround, you can use the Black Formatter extension. After installing Pyink and the extension, you can set these in VS Code's settings.json:

{
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter"
    },
    "black-formatter.path": [
        "path/to/pyink"
    ]
}

Yes! You can put the following in your .pre-commit-config.yaml file:

repos:
  - repo: https://github.com/google/pyink
    rev: 23.3.0
    hooks:
      - id: pyink
        # It is recommended to specify the latest version of Python
        # supported by your project here, or alternatively use
        # pre-commit's default_language_version, see
        # https://pre-commit.com/#top_level-default_language_version
        language_version: python3.9

We want a name with the same number of characters as Black, to make patching easier. And squid ink is black.

MIT

See the contribution guide.

See CHANGES.md.

This is not an officially supported Google product.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4