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

smart mode is broken if pyproject.toml exists in project #40

Open
lovetox opened this issue Sep 5, 2023 · 0 comments
Open

smart mode is broken if pyproject.toml exists in project #40

lovetox opened this issue Sep 5, 2023 · 0 comments

Comments

@lovetox
Copy link

lovetox commented Sep 5, 2023

smart mode seems to depend on the parse_pyproject_toml() returning an empty dict

But parse_pyproject_toml() never returns an empty dict, if pyproject.toml exists, because even if no black key is found in pyproject.toml and the dict would be indeed empty, it adds a target_version key after.

i would make a PR but it seems not straight forward whats the best solution here

Ideas i had:

  • return also a bool that signals if the black key was found in the config?
  • pass the smart mode as argument to parse_pyproject_toml(), and return before target version is added
  • parse the black dict from pyproject into a black key into the config dict, that would allow the following code to check if the black key is empty, but would make code later which access the config a bit less pretty
@lovetox lovetox changed the title smart mode is broken smart mode is broken if pyproject.toml exists in project Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant