Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore pyproject.toml missing tool.black section #4204

Merged
merged 4 commits into from
Feb 2, 2024

Commits on Feb 2, 2024

  1. Ignore pyproject.toml missing tool.black section

    Fixes psf#2863
    
    This is pretty desirable in a monorepo situation where you have
    configuration in the root since it will mean you don't have to
    reconfigure every project.
    
    The good news for backward compatibility is that `find_project_root`
    continues to stop at any git or hg root, so in all cases repo root
    coincides with a pyproject.toml missing tool.black, we'll continue to
    have the project root as before and end up using default config
    (i.e. we're unlikely to randomly start using the user config).
    
    The other thing we need to be a little careful about is that changing
    find_project_root logic affects what `exclude` is relative to.  Since we
    only change in cases where there is no config, this only applies where
    users were using `exclude` via command line arg (and had pyproject.toml
    missing tool.black in a dir that was not repo root).
    
    Finally, for the few who could be affected, the fix is to put an empty
    `[tool.black]` in pyproject.toml
    hauntsaninja committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    c80773e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d7dc8c7 View commit details
    Browse the repository at this point in the history
  3. changes

    hauntsaninja committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    37a18fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7c504b2 View commit details
    Browse the repository at this point in the history