Skip to content

Apply excludes before normalising symlinks #3527

@itoijala-huld

Description

@itoijala-huld

Is your feature request related to a problem? Please describe.

Our project contains symlinks like this:

project
+- a
   +- b -> ../x/y
   +- other files
+- x
   +- y
      +- lots of files

We would like to avoid black spending time formatting/complaining about the same files twice, so we make the excludes regex match /a/b/.
This doesn't help because the excludes are evaluated after normalising the path to /x/y/.
We cannot put that in the excludes because we do want to format the files.

Describe the solution you'd like

Excludes could be evaluated before normalising the path, or at least before evaluating symlinks.

Describe alternatives you've considered

Perhaps it would be best to evaluate excludes both before and after normalising the path.
There is also a use case for the way it is now, if we did want to exclude the files completely without listing all paths to them in the excludes.

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: enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions