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.
* Implement a re-usable GitHub Action
Implement a GitHub action that can be reused across projects that want
to run black as part of their CI workflows.
* Fix typo in README.md
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Use latest Python 3
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
--- /dev/null
+FROM python:3
+
+ENV PYTHONDONTWRITEBYTECODE 1
+ENV PYTHONUNBUFFERED 1
+
+RUN pip install --upgrade --no-cache-dir black
+
+ENTRYPOINT /usr/local/bin/black --check --diff .
**[pyproject.toml](#pyprojecttoml)** | **[Editor integration](#editor-integration)** |
**[blackd](#blackd)** | **[black-primer](#black-primer)** |
**[Version control integration](#version-control-integration)** |
**[pyproject.toml](#pyprojecttoml)** | **[Editor integration](#editor-integration)** |
**[blackd](#blackd)** | **[black-primer](#black-primer)** |
**[Version control integration](#version-control-integration)** |
+**[GitHub Actions](#github-actions)** |
**[Ignoring unmodified files](#ignoring-unmodified-files)** | **[Used by](#used-by)** |
**[Testimonials](#testimonials)** | **[Show your style](#show-your-style)** |
**[Contributing](#contributing-to-black)** | **[Change log](#change-log)** |
**[Ignoring unmodified files](#ignoring-unmodified-files)** | **[Used by](#used-by)** |
**[Testimonials](#testimonials)** | **[Show your style](#show-your-style)** |
**[Contributing](#contributing-to-black)** | **[Change log](#change-log)** |
`stable` is a branch that tracks the latest release on PyPI. If you'd rather run on
master, this is also an option.
`stable` is a branch that tracks the latest release on PyPI. If you'd rather run on
master, this is also an option.
+## GitHub Actions
+
+Create a file named `.github/workflows/black.yml` inside your repository with:
+
+```yaml
+name: Lint
+
+on: [push, pull_request]
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-python@v2
+ - uses: psf/black@stable
+```
+
## Ignoring unmodified files
_Black_ remembers files it has already formatted, unless the `--diff` flag is used or
## Ignoring unmodified files
_Black_ remembers files it has already formatted, unless the `--diff` flag is used or
--- /dev/null
+name: "Black"
+description: "The uncompromising Python code formatter."
+author: "Łukasz Langa and contributors to Black"
+branding:
+ color: "black"
+ icon: "check-circle"
+runs:
+ using: "docker"
+ image: "Dockerfile"