summaryrefslogtreecommitdiff
path: root/mesonbuild/ast/postprocess.py
AgeCommit message (Collapse)Author
2024-04-08visit full ast for AstConditionLevelCharles Brunet
Use the new `FullAstVisitor` for `AstConditionLevel`. This will allow proper formatting of `if / else / endif` and `foreach / endforeach` blocks.
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz
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/ ```
2023-02-28refactor a few subsystem-relative imports that imported the wrong locationEli Schwartz
Inside of mesonbuild.ast.* we can and should import from .foobar, rather than importing from .__init__'s re-exported version of that object. Failing to do so results in an extremely brittle codebase where simply changing the order of lines in __init__.py can result in ImportError.
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz
2020-09-08typing: completely type astDaniel Mensinger
2020-03-02types: Remove redundant __init__() -> None annotationDaniel Mensinger
2020-03-02types: Use import typing as TDaniel Mensinger
2020-03-02types: Annotate the AST visitorsDaniel Mensinger
2019-03-03mintro: Dependencies from sourceDaniel Mensinger
2019-01-22AST post processingDaniel Mensinger