PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.49k stars 580 forks source link

Surveying defaults #1812

Open abitrolly opened 3 years ago

abitrolly commented 3 years ago

If I say that this is the defaults the most users want, what are the chances for defaults to be changed?

[tool.isort]
profile = 'black'
lines_between_types = 1
combine_as_imports = true

There is actually a way to survey the defaults.

  1. [ ] Have a page in docs with instructions
  2. [ ] Add an option survey_defaults = true
  3. [ ] Instruction should say "To participate in the GitHub survey of default options, move your config into pyproject.toml and add survey_defaults=true to it. This option will signal that these are the options that you want to see as default."
  4. [ ] Run campaign for a year
  5. [ ] Use GitHub search https://github.com/search?q=filename%3Apyproject.toml+path%3A%2F+survey_defaults&type=Code to find submitted configs and build stats out of them
timothycrosley commented 3 years ago

I'm pretty on board with changing the defaults to

[tool.isort]
profile = 'black'
combine_as_imports = true

for isort 6+. Or more directly, making combine_as_imports true part of the black profile, and making isort default to using the black profile. I haven't seen much usage of lines_between_types = 1, but I am open to being wrong there and would love any additional input

WhyNotHugo commented 3 years ago

I'm a fan of sticking to defaults, so only change these settings so they align with black.

[tool.isort]
profile = black
force_single_line = true

force_single_line aligns with black's mentality of "reducing merge conflicts" and also maximises readability. Without it unreadable merge conflicts pop up continuously, and they're a pain to deal with.

timothycrosley commented 3 years ago

@WhyNotHugo, you know how I feel about this, and certainly you must know that your argument of it being along black's mentality is only true from one perspective, but not true from just as many others.

https://github.com/PyCQA/isort/issues/1791#issuecomment-886263310

I don't feel as an owner who would push his way on others, so if I genuinely felt or there was considerable usage of that setting across the community I would entertain it. As it is currently, I don't see it too often and I think that, your way of thinking about it while certainly true for you, isn't the community consensus, and most people prefer the imports to be grouped and that most people see the absence of that setting as much more aligned with how black formats.