]> git.madduck.net Git - etc/vim.git/blob - docs/usage_and_configuration/black_docker_image.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add option to skip the first line of source code (#3299)
[etc/vim.git] / docs / usage_and_configuration / black_docker_image.md
1 # Black Docker image
2
3 Official _Black_ Docker images are available on
4 [Docker Hub](https://hub.docker.com/r/pyfound/black).
5
6 _Black_ images with the following tags are available:
7
8 - release numbers, e.g. `21.5b2`, `21.6b0`, `21.7b0` etc.\
9   ℹ Recommended for users who want to use a particular version of _Black_.
10 - `latest_release` - tag created when a new version of _Black_ is released.\
11   ℹ Recommended for users who want to use released versions of _Black_. It maps to [the latest release](https://github.com/psf/black/releases/latest)
12   of _Black_.
13 - `latest` - tag used for the newest image of _Black_.\
14   ℹ Recommended for users who always want to use the latest version of _Black_, even before
15   it is released.
16
17 There is one more tag used for _Black_ Docker images - `latest_non_release`. It is
18 created for all unreleased
19 [commits on the `main` branch](https://github.com/psf/black/commits/main). This tag is
20 not meant to be used by external users.
21
22 ## Usage
23
24 A permanent container doesn't have to be created to use _Black_ as a Docker image. It's
25 enough to run _Black_ commands for the chosen image denoted as `:tag`. In the below
26 examples, the `latest_release` tag is used. If `:tag` is omitted, the `latest` tag will
27 be used.
28
29 More about _Black_ usage can be found in
30 [Usage and Configuration: The basics](./the_basics.md).
31
32 ### Check Black version
33
34 ```console
35 $ docker run --rm pyfound/black:latest_release black --version
36 ```
37
38 ### Check code
39
40 ```console
41 $ docker run --rm --volume $(pwd):/src --workdir /src pyfound/black:latest_release black --check .
42 ```
43
44 _Remark_: besides [regular _Black_ exit codes](./the_basics.md) returned by `--check`
45 option, [Docker exit codes](https://docs.docker.com/engine/reference/run/#exit-status)
46 should also be considered.