summaryrefslogtreecommitdiff
path: root/mesonbuild/mformat.py
AgeCommit message (Collapse)Author
2025-10-15Add --check-diff to meson format, to show what should be formattedJulianne Swinoga
2025-10-08format: fix indentation at beginning of argumentsCharles Brunet
Fixes #14998
2025-10-01format: fix handling whitespaces after string nodeCharles Brunet
Fixes #15019
2025-09-24format: Fix indentation with parenthesesCharles Brunet
- Split long expressions in () according to max line length - Partly revert d028502 . Fixes #14935. - Fixes #15032.
2025-08-26mformat: force multiline arguments with commaCharles Brunet
Force multiline arguments when there is a trailing comma. This is the behavior of muon. Fixes #14721.
2025-08-26format: do not group '--' argCharles Brunet
The group_arg_value option allow to put --key and its value on the same line on multiline arguments. However, when the options is `--`, it is an argument separator, and should not be grouped with the following argument.
2025-08-01format: add --source-file-path argument for stdinCharles Brunet
Fixes #14539. Otherwise, .editorconfig is read from current working directory, and there is no way to know what file name to filter to choose the right section of editor config.
2025-08-01format: use absolute paths to find .editorconfigCharles Brunet
Fixes #14538. Resolve the source file path before searching .editorconfig files, to ensure parents up to the root directory are visited.
2025-04-29Fix meson format with multi line parenthesized expressionsWill Ayd
2025-01-31mformat: try to detect meson.format in source files' parent directorieswrvsrx
2024-12-06format: allow input from stdinCharles Brunet
Fixes #13791
2024-09-06mformat: better handling of continuation linesCharles Brunet
Fixes #13566. Fixes #13567.
2024-09-06mformat: detect invalid configCharles Brunet
- detect unknown config keys in format config - add test for detection of invalid config values - detect invalid .editorconfig values Fixes #13569
2024-09-05mformat: regenerate long lines even if they're already multilineBenjamin Gilbert
If kwargs_force_multiline is enabled, an ArgumentNode in a kwarg value can already be marked multiline by the time we notice that the line needs to be broken for length. Ensure we still break the line in this case. Fixes: #13512
2024-09-04mformat: provide nice error message instead of backtrace for invalid valueDylan Baker
I ran into this with `option = true;` (note the trailing `;`). Now we provide a nicer message instead of an uncaught Python backtrace. Closes: #13565
2024-08-20mformat: A triple string with a ' in it cannot be simplifiedDylan Baker
The following is valid meson: ```meson a = '''This string can't be simplified''' ``` which cannot be simplified because of the `'` in it, as ```meson a = 'This string can't be simplified' ``` Is invalid. Potentially we could convert that with escapes, but it seems reasonable to me to leave this, since it may be desirable to not have lots of escapes in a string. `'''I can't believe it's her's!'''` is much more readable than `'I can\'t believe it\'s her\'s!'`, for example. Closes: #13564
2024-08-20format: fix indentation of commentsCharles Brunet
Fixes #13508 - Fix indentation of comments in arrays - Fix indentation of comments in dicts - Fix indentation of comments in if clauses - Fix indentation of comments in foreach clauses
2024-08-19mformat: correctly handle editorconfig files without the root settingDylan Baker
Which happens when a .editorconfig is in a subdirectory, not the root. In this case we need Set the fallback value to `False`, which is what editorconfig expects. Closes: #13568
2024-08-01mformat: fix formatting of empty build fileCharles Brunet
Running meson format multiple times on an empty file was adding a new line each time, which is bad for pre-commit checks...
2024-07-30flake8: move unused typing-only imports to TYPE_CHECKINGEli Schwartz
2024-06-26format: fix edge case with empty functionsCharles Brunet
format was adding a new empty line each time when trying to split a long line containing a function with no arguments
2024-06-19mformat: fix else token not correctly indentedCharles Brunet
fixes #13316
2024-06-19Fix crash in meson formatCharles Brunet
There was a case where a trailing comma was missing a whitespaces attribute Fixes #13242
2024-06-19Catch format configuration parse errorCharles Brunet
2024-04-08meson format commandCharles Brunet