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

Fix misdetection of project root with --stdin-filename #3216

Merged
merged 6 commits into from
Aug 26, 2022

Commits on Aug 10, 2022

  1. Fix misdetection of project root with --stdin-filename

    There are a number of places this behaviour could be patched, for
    instance, it's quite tempting to patch it in `get_sources`. However
    I believe we generally have the invariant that project root contains all
    files we want to format, in which case it seems prudent to keep that
    invariant.
    
    Fixes psf#3207
    hauntsaninja committed Aug 10, 2022
    Configuration menu
    Copy the full SHA
    6e4b7e5 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2022

  1. Configuration menu
    Copy the full SHA
    3d01880 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2022

  1. Configuration menu
    Copy the full SHA
    8d1bef5 View commit details
    Browse the repository at this point in the history
  2. changelog

    hauntsaninja committed Aug 12, 2022
    Configuration menu
    Copy the full SHA
    679207e View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2022

  1. add a test

    hauntsaninja committed Aug 24, 2022
    Configuration menu
    Copy the full SHA
    6453abf View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2022

  1. Fix test that passes on main anyway

    Black searches parent directories if the common base of the given
    sources doesn't contain a "project root marker" so simply setting
    --stdin-filename to `../whatever.py` won't cause any problems. Instead
    let's set --stdin-filename to `../src/a.py` as `src` has its own
    pyproject.toml file. Currently on main, the detected root will be the
    parent directory of `src` but with this PR it'll be `src` as expected.
    ichard26 committed Aug 26, 2022
    Configuration menu
    Copy the full SHA
    5a8dcfe View commit details
    Browse the repository at this point in the history