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 indentation in our tox.ini and the docs #1110

Closed
obestwalter opened this issue Dec 29, 2018 · 11 comments
Closed

Fix indentation in our tox.ini and the docs #1110

obestwalter opened this issue Dec 29, 2018 · 11 comments
Assignees
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Milestone

Comments

@obestwalter
Copy link
Member

Going through the docs I saw this:

[tox]
minversion = 2.0
envlist = py{27,36}-{mylinux,mymacos,mywindows}

[testenv]
sys.platform string
platform = mylinux: linux
           mymacos: darwin
           mywindows: win32

# you can specify dependencies and their versions based on platform filtered environments
deps = mylinux,mymacos: py==1.4.32
       mywindows: py==1.4.30

# upon tox invocation you will be greeted according to your platform
commands=
   mylinux: python -c 'print("Hello, Linus!")'
   mymacos: python -c 'print("Hello, Steve!")'
   mywindows: python -c 'print("Hello, Bill!")'

there are two different ways of indenting multi-line values used here and all over the docs:

somekey = foo = BAR
          bar
          baz
somothermuchlongerkey = foo = BAR
                        bar
                        baz

vs

somekey = 
    foo = BAR
    bar
    baz
somothermuchlongerkey = 
    foo = BAR
    bar
    baz

I strongly prefer variant two not just for aesthetical reasons. I find it much easier to read. Especially for things like

deps = mylinux,mymacos: py==1.4.32
       mywindows: py==1.4.30
deps = 
    mylinux,mymacos: py==1.4.32
    mywindows: py==1.4.30

the second variant is much clearer and easier to read.

@gaborbernat
Copy link
Member

I personally prefer the smaller number of lines. It's more compact and I find there's plenty of wide space on today's monitors.

@gaborbernat
Copy link
Member

I also think having a single indentation by the equal sign makes things more readable, but that could be just me.

@obestwalter
Copy link
Member Author

obestwalter commented Dec 29, 2018

It's more compact and I find there's plenty of wide space on today's monitors.

My personal experience is that I prefer shorter line lengths independent of how wide my monitor is. I was really happy with Pythons PEP 8 limitation of 79 chars per line. Even with a line length of 88 (the new emerging standard thanks to black) a side by side diff is breaking up already if your eyesight is not that great (like mine) and need a bigger font. The even longer line length of the code in the tox project feels really unwieldy to me and that is also something I would like to address, but not in this issue.

@gaborbernat
Copy link
Member

I've personally like 120, but decided to meet you half way at 99 back when we introduced black. I guess this is the place where we diverge on opinions on what is easy to read. I myself find hard to read when we try to squeeze stuff into 88 characters.

@obestwalter
Copy link
Member Author

that is also something I would like to address, but not in this issue.

-- me further above :)

@gaborbernat
Copy link
Member

Well I was just putting it out that we probably would have a sharp difference of opinion would you open that issue, as it would feel like you're opening issues already discussed and settled a few months back.

@asottile
Copy link
Contributor

@obestwalter strong agree from my end on your preference of format. Avoids manual 13-space indents and is much easier to separate key from value.

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label May 3, 2019
@jugmac00
Copy link
Member

jugmac00 commented Apr 12, 2021

At least the upcoming version 4 uses tox-ini-fmt via pre-commit which autoformats tox.ini.

Issue can be closed as soon as we support tox4.

P.S.: oops, it is about the docs.... I bet @gaborbernat takes great care when migrating them via #1914

@gaborbernat gaborbernat added this to the 4.0 milestone Apr 12, 2021
@jugmac00
Copy link
Member

jugmac00 commented Aug 7, 2021

I just skimmed the documentation for tox4, and the indentation looks good!

Though, the example section has not been moved over to the tox4 documentation.

@gaborbernat What are your plans for https://tox.readthedocs.io/en/3.24.1/examples.html ? Will we have an example section for tox4, too? I am all in favor, but we'd need to go through all examples and check whether they are still valid (e.g. the subsection on nose can be omitted).

@gaborbernat
Copy link
Member

Yeah, basically those 👍 will create a new ticket for the examples 👍

@gaborbernat
Copy link
Member

See #2143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
Development

No branches or pull requests

4 participants