WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@janjachnik-dyson
Copy link

Description

This is one possible fix for: #3040

I have added the --project-root command line argument which can be used to force black to evaluate paths relative to that root. Otherwise, black will pick up things like .git folders in submodules and use the submodule path as the project root instead.

We want to auto-format our code in Visual Studio Code but want to exclude 3rd-party git submodules by specifying them in pyproject.toml. This is needed to make that work.

Checklist - did you ...

  • Add a CHANGELOG entry if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@cooperlees cooperlees added C: configuration CLI and configuration C: file collection Related to file collection (e.g. gitignore & cache) or file discovery and all of its configuration. labels Jun 9, 2022
@github-actions
Copy link

github-actions bot commented Jun 9, 2022

diff-shades reports zero changes comparing this PR (181ea24) to main (f51e537).


What is this? | Workflow run | diff-shades documentation

This makes the behaviour of the tests better mimic real-world usage. Now
the git submodule full path test fails, reproducing the bug seen in
real-world usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: configuration CLI and configuration C: file collection Related to file collection (e.g. gitignore & cache) or file discovery and all of its configuration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants