.clang-format
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 25 Nov 2022 18:39:47 -0500
changeset 49793 8147abc05794
parent 36224 d0a3fa849cb8
permissions -rw-r--r--
pytype: stop excluding mercurial/ui.py ui.extractchoices() is perhaps making assumptions that it shouldn't about the pattern always matching, but presumably we have test coverage for that. PyCharm flags the updated classes with a warning "Class xxx must implement all abstract methods", and suggests adding `abc.ABC` to the superclasses. I'm not sure why, unless it doesn't recognize the `__getattr__()` delegation pattern. Additionally, we can't unconditionally subclass `typing.BinaryIO` because that defeats the `__getattr__` delegation to the wrapped object at runtime. Instead, it has to only subclass during the type checking phase[1]. In any event, this fixes: File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1518, in _runpager: Function subprocess.Popen.__new__ was called with the wrong arguments [wrong-arg-types] Expected: (cls, args, bufsize, executable, stdin, stdout: Optional[Union[IO, int]] = ..., ...) Actually passed: (cls, args, bufsize, stdin, stdout: Union[mercurial.utils.procutil.WriteAllWrapper, mercurial.windows.winstdout], ...) File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1798, in extractchoices: No attribute 'group' on None [attribute-error] In Optional[Match[bytes]] File "/mnt/c/Users/Matt/hg/mercurial/ui.py", line 1799, in extractchoices: No attribute 'group' on None [attribute-error] In Optional[Match[bytes]] [1] https://stackoverflow.com/q/71365594
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34798
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     1
BasedOnStyle: LLVM
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     2
IndentWidth: 8
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     3
UseTab: ForIndentation
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     4
BreakBeforeBraces: Linux
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     5
AllowShortIfStatementsOnASingleLine: false
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     6
IndentCaseLabels: false
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     7
AllowShortBlocksOnASingleLine: false
e33381d95930 clang-format: configuration for the clang-format source formatter
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     8
AllowShortFunctionsOnASingleLine: false
36224
d0a3fa849cb8 formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents: 34798
diff changeset
     9
IncludeCategories:
d0a3fa849cb8 formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents: 34798
diff changeset
    10
  - Regex:           '^<'
d0a3fa849cb8 formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents: 34798
diff changeset
    11
    Priority:        1
d0a3fa849cb8 formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents: 34798
diff changeset
    12
  - Regex:           '^"'
d0a3fa849cb8 formatting: enforce system headers before local headers
Augie Fackler <augie@google.com>
parents: 34798
diff changeset
    13
    Priority:        2