diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-10 21:19:29 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-11 13:41:03 -0400 |
| commit | 90ce0841441506e3f409ab59ded1df8f2e6e7363 (patch) | |
| tree | 3478769eef2620e9d7b5a41b73dd94c75b003465 /mesonbuild/scripts | |
| parent | de1cc0b02bcb1bab6977f0ab8bb3fef0cd0646dd (diff) | |
| download | meson-90ce0841441506e3f409ab59ded1df8f2e6e7363.tar.gz | |
treewide: automatic rewriting of all comment-style type annotations
Performed using https://github.com/ilevkivskyi/com2ann
This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.
So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.
Repeat with:
```
com2ann mesonbuild/
```
Diffstat (limited to 'mesonbuild/scripts')
| -rwxr-xr-x | mesonbuild/scripts/cmake_run_ctgt.py | 2 | ||||
| -rw-r--r-- | mesonbuild/scripts/depfixer.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/scripts/cmake_run_ctgt.py b/mesonbuild/scripts/cmake_run_ctgt.py index 755530a68..df3f36185 100755 --- a/mesonbuild/scripts/cmake_run_ctgt.py +++ b/mesonbuild/scripts/cmake_run_ctgt.py @@ -9,7 +9,7 @@ from pathlib import Path import typing as T def run(argsv: T.List[str]) -> int: - commands = [[]] # type: T.List[T.List[str]] + commands: T.List[T.List[str]] = [[]] SEPARATOR = ';;;' # Generate CMD parameters diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index b9c58fee5..593efd9f7 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -123,8 +123,8 @@ class Elf(DataSizes): def __init__(self, bfile: str, verbose: bool = True) -> None: self.bfile = bfile self.verbose = verbose - self.sections = [] # type: T.List[SectionHeader] - self.dynamic = [] # type: T.List[DynamicEntry] + self.sections: T.List[SectionHeader] = [] + self.dynamic: T.List[DynamicEntry] = [] self.open_bf(bfile) try: (self.ptrsize, self.is_le) = self.detect_elf_type() @@ -329,7 +329,7 @@ class Elf(DataSizes): old_rpath = self.read_str() # Some rpath entries may come from multiple sources. # Only add each one once. - new_rpaths = OrderedSet() # type: OrderedSet[bytes] + new_rpaths: OrderedSet[bytes] = OrderedSet() if new_rpath: new_rpaths.update(new_rpath.split(b':')) if old_rpath: |
