X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/7403d95862ae54c3504a8003666e1a0739067894..b2c13de4906411ff0b3e20ec5a61f5803a660119:/README.md diff --git a/README.md b/README.md index 80ef534..16dd837 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ _Contents:_ **[Installation and usage](#installation-and-usage)** | **[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)** | @@ -58,6 +59,12 @@ To get started right away with sensible defaults: black {source_file_or_directory} ``` +You can run _Black_ as a package if running it as a script doesn't work: + +```sh +python -m black {source_file_or_directory} +``` + ### Command line options _Black_ doesn't provide many options. You can list them by running `black --help`: @@ -375,6 +382,24 @@ If you're already using Python 3.7, switch the `language_version` accordingly. F `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