Skip to content

Bug on regular expression with black-21.12b0 #2677

Description

@ValentinRicher

Describe the bug

To Reproduce

With pyproject.toml

[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38']
exclude = '''
/(
    \.eggs
  | \.git
  | \.mypy_cache
  | \.tox
  | \.env.*
  | \env
  | \.venv
  | \.venv2
  | venv
  | venv2
  | _build
  | build
  | dist
  | examples
  | docs

)/
'''

And run it with these arguments:

$ black --config="pyproject.toml" .

The resulting error is:

Error: Invalid value for '--exclude': Not a valid regular expression

Environment

  • Black's version: 21.12b0
  • OS and Python version: macOs BigSur Python 3.8.10

Additional context

No problem with previous versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions