Skip to content

Ignore formatting a nested folder #2010

@SadmiB

Description

@SadmiB

I'm trying black formatter github actions and I want to ignore formatting a nested folder, the documentation says that the --exclude accepts a regex but it didn't worked, I tested both regex and text as input.

Example of the tests I did:

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
        with:
          args: ". --check --exclude /(folder1/folder2)/"

I tested many other combinations too, but the directory is always included. is this a bug or I'm missing something(the documentation is not concentrated on the github action)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: file collectionRelated to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.T: user supportOP looking for assistance or answers to a question

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions