aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/depscan.py
AgeCommit message (Collapse)AuthorFilesLines
2022-07-25ninja depscanner: handle C++ sources named capital CEli Schwartz1-1/+3
In commit 4ca9a16288f51cce99624a2ef595d879acdc02d8 we added unreliable support (it warns you if you try it) for gcc-compatible treatment of uppercase-C files being C++ instead of C. In order to handle it correctly, we needed to evaluate can-compile by special-casing "C" to avoid lowercasing it for comparisons. This didn't cover all cases where we check if "C" is a C++ language file. We also straight-up check the language of a file (rather than working backwards to see if a C++ compiler can compile it) when doing module scanning, and this needs to special-case "C" as well. We also had one case where we only checked lowercase fortran extensions, but not lowercase C++ extensions. While we are at it, use lowercase for C++ as well, except the "C" special case. Fixes #10629
2022-07-16Ignore encoding errors when scanning. Closes #10571.Jussi Pakkanen1-2/+2
In Fortran and C++ all the bits we care about are in ASCII. 8-bit characters can only occur in comments and string literals and we don't parse those.
2022-03-29move a bunch of imports into TYPE_CHECKING blocksEli Schwartz1-6/+10
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-1/+1
2021-10-04fix extra whitespaceEli Schwartz1-1/+0
discovered via flake8 --select E303
2021-10-04various python neatness cleanupsEli Schwartz1-1/+1
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-08-31pylint: turn on superflous-parensDylan Baker1-2/+2
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-18backends/ninja: write depscan input files to jsonDylan Baker1-4/+6
Currently, we write each file to the command line, but this can result in situations where the number of files passed exceeds OS imposed command line limits. For compilers, we solve this with response files. For depscan I've chosen to use a JSON list instead. JSON has several advantages in that it's standardized, there's a built-in python module for it, and it's familiar. I've also chosen to always use the JSON file instead of having a heuristic to decide between JSON and not JSON, while there may be a small performance trade off here, keeping the implementation simple with only one path is wort it. Fixes #9129
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-3/+3
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-5/+5
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04raw string literals are next to godlinessEli Schwartz1-2/+2
Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
2021-01-20Use case-insensitive suffix check for fortranJonas Lundholm Bertelsen1-2/+2
In Fortran it is common to use capital F in the suffix (eg. '.F90') if the source file makes use of preprocessor statements. Such files should probably be treated like all other fortran files by meson. Case insensitivity for suffixes was already implemented several places in meson before this. So most likely, the few places changed here were oversights anyway.
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2020-12-25Extend the C++ module scanner to handle Fortran, too.Jussi Pakkanen1-19/+129
2020-12-13Add mypy annotations.Jussi Pakkanen1-11/+13
2020-12-13Scan all C++ sources and ignore everything else.Jussi Pakkanen1-0/+2
2020-12-13C++ module compilation works for a simple project.Jussi Pakkanen1-0/+87