diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-14 22:51:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-14 22:51:14 +0200 |
| commit | 2e0a4e716f136d86727f903fdeb4b107e471d524 (patch) | |
| tree | d8e5ab819a3bc637bd27ac36511628da29c9180d /script/fix_documentation.py | |
| parent | a693ea7e1785def007c5a80d379cc7aaf92f38a9 (diff) | |
| download | pylint-git-2e0a4e716f136d86727f903fdeb4b107e471d524.tar.gz | |
Add some manual typing changes (#6325)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Diffstat (limited to 'script/fix_documentation.py')
| -rw-r--r-- | script/fix_documentation.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/script/fix_documentation.py b/script/fix_documentation.py index 24dd0097e..e248f0646 100644 --- a/script/fix_documentation.py +++ b/script/fix_documentation.py @@ -3,10 +3,12 @@ # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Small script to fix various issues with the documentation. Used by pre-commit.""" + +from __future__ import annotations + import argparse import re import sys -from typing import List, Optional, Union INVALID_CODE_BLOCK_PATTERN = ( r"(?<=\s`)([\w\-\.\(\)\=]+\s{0,1}[\w\-\.\(\)\=]*)(?=`[,\.]{0,1}\s|$)" @@ -50,7 +52,7 @@ class CustomHelpFormatter(argparse.HelpFormatter): prog: str, indent_increment: int = 2, max_help_position: int = 24, - width: Optional[int] = None, + width: int | None = None, ) -> None: max_help_position = 40 super().__init__( @@ -61,7 +63,7 @@ class CustomHelpFormatter(argparse.HelpFormatter): ) -def main(argv: Union[List[str], None] = None) -> int: +def main(argv: list[str] | None = None) -> int: argv = argv or sys.argv[1:] parser = argparse.ArgumentParser(formatter_class=CustomHelpFormatter) parser.add_argument( |
