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

Move configs into pyproject.toml or setup.cfg(flake8) #484

Merged
merged 2 commits into from
Sep 25, 2021
Merged

Move configs into pyproject.toml or setup.cfg(flake8) #484

merged 2 commits into from
Sep 25, 2021

Conversation

FollowTheProcess
Copy link
Collaborator

This PR moves a few configs over to either pyproject.toml or setup.cfg in the case of flake8. Summary below:

  • isort config moved from .isort.cfg to pyproject.toml (also added recommended multi line output setting for black compatibility see here)
  • coverage config moved from .coveragerc to pyproject.toml (the nox cover session now installs coverage[toml] over just coverage to achieve this)
  • flake8 config moved from .flake8 to setup.cfg. I'm hoping they support pyproject.toml soon!

This is mainly me being a bit OCD and it doesn't actually alter any functionality so please feel free to reject if we want to keep separate files for clarity etc. 🙂

Copy link
Collaborator

@cjolowicz cjolowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Is the multiline setting actually necessary? I understood the isort config example as saying "use black profile for compatibility, and you can apply other options like multiline on top of that".

@FollowTheProcess
Copy link
Collaborator Author

LGTM

Is the multiline setting actually necessary? I understood the isort config example as saying "use black profile for compatibility, and you can apply other options like multiline on top of that".

I'm actually not too sure it's just a habit for me at this point. It didn't seem to change anything, perhaps in some edge cases it would behave differently.

Happy to take it out if we don't want that setting?

@cjolowicz
Copy link
Collaborator

I was curious and checked. isort has this definition for the black profile:

black = {
    "multi_line_output": 3,
    "include_trailing_comma": True,
    "force_grid_wrap": 0,
    "use_parentheses": True,
    "ensure_newline_before_comments": True,
    "line_length": 88,
}

So the multiline setting actually duplicates the profile settings.

@FollowTheProcess
Copy link
Collaborator Author

I was curious and checked. isort has this definition for the black profile:

black = {
    "multi_line_output": 3,
    "include_trailing_comma": True,
    "force_grid_wrap": 0,
    "use_parentheses": True,
    "ensure_newline_before_comments": True,
    "line_length": 88,
}

So the multiline setting actually duplicates the profile settings.

Well TIL! Thanks for that! Guess I'd best go and drop that from all my other projects then 👀

@FollowTheProcess FollowTheProcess merged commit e679b77 into wntrblm:main Sep 25, 2021
@FollowTheProcess FollowTheProcess deleted the pyproject-config branch September 25, 2021 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants