Skip to content

.gitignore is ignored by black if more than one source location is specified #3291

@szandara

Description

@szandara

Describe the bug

When adding more than one source entry, black ignores the .gitignore entries.

To Reproduce

content of .gitignore

generated/*

Running

black test src

produces

$ black --check tests src
would reformat generated/jtd/__init__.py

Oh no! 💥 💔 💥
1 file would be reformatted, 29 files would be left unchanged.

Running

black src

produces

$ black --check src
All done! ✨ 🍰 ✨

Expected behavior

$ black --check test src
All done! ✨ 🍰 ✨

Environment

  • Black's version: 22.8.0
  • OS and Python version: MacOS m1

Additional context

works with Black version: 22.6.0

Metadata

Metadata

Assignees

Labels

C: file collectionRelated to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.T: bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions