black.toml
author Kyle Lippincott <spectral@google.com>
Mon, 23 Mar 2020 14:38:00 -0700
branchstable
changeset 44594 c23877cb25a5
parent 43386 2247bf3cec76
child 44147 5e84a96d865b
permissions -rw-r--r--
darwin: use vim, not vi, to avoid data-loss inducing posix behavior Apple's version of vim, available at opensource.apple.com/release/macos-1015.html (for Catalina, but this behavior has been there for a while) has several tweaks from the version of vim from vim.org. Most of these tweaks appear to be for "Unix2003" compatibility. One of the tweaks is that if any ex command raises an error, the entire process will (when you exit, possibly minutes/hours later) also exit non-zero. Ex commands are things like `:foo`. Luckily, they only enabled this if vim was executed (via a symlink or copying the binary) as `vi` or `ex`. If you start it as `vim`, it doesn't have this behavior, so let's do that. To see this in action, run the following two commands on macOS: ``` $ vi -c ':unknown' -c ':qa' ; echo $? 1 $ vim -c ':unknown' -c ':qa' ; echo $? 0 ``` We don't want to start ignoring non-zero return types from the editor because that will mean you can't use `:cquit` to intentionally exit 1 (which, shows up as 2 if you combine an ex command error and a cquit, but only a 1 if you just use cquit, so we can't differentiate between the two statuses). Since we can't differentiate, we have to assume that all non-zero exit codes are intentional and an indication of the user's desire to not continue with whatever we're doing. If this was a complicated `hg split` or `hg histedit`, this is especially disastrous :( Differential Revision: https://phab.mercurial-scm.org/D8321
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43064
929678eb4cbd black: add a pyproject.toml that contains our black settings
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
[tool.black]
929678eb4cbd black: add a pyproject.toml that contains our black settings
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
line-length = 80
43224
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     3
exclude = '''
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     4
build/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     5
| wheelhouse/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     6
| dist/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     7
| packages/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     8
| \.hg/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
     9
| \.mypy_cache/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
    10
| \.venv/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
    11
| mercurial/thirdparty/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
    12
| contrib/python-zstandard/
2a201b366d5b black: use multiline exclude definition
Augie Fackler <augie@google.com>
parents: 43223
diff changeset
    13
'''
43223
15c05732d177 black: move remaining config knobs into toml file
Augie Fackler <augie@google.com>
parents: 43222
diff changeset
    14
skip-string-normalization = true
15c05732d177 black: move remaining config knobs into toml file
Augie Fackler <augie@google.com>
parents: 43222
diff changeset
    15
quiet = true