summaryrefslogtreecommitdiff
path: root/mesonbuild/rewriter.py
Commit message (Collapse)AuthorAgeFilesLines
* pylint: turn on superflous-parensDylan Baker2021-08-311-5/+5
| | | | | | | | 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.
* pylint: turn on superfluous parens warningDylan Baker2021-08-311-6/+6
| | | | | Which is really useful for catching parens used with keywords like assert. Don't use parens with assert, it's bad.
* fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger2021-06-291-4/+4
|
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-041-5/+5
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* various python neatness cleanupsEli Schwartz2021-03-041-2/+2
| | | | | | | | | | | | | | | | All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
* Allow '//' as project function id due to git bash path conversion.Luke Elliott2021-01-121-2/+6
| | | | See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
* Use a single coredata dictionary for optionsDylan Baker2021-01-041-5/+5
| | | | | | | This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
* use OptionKey for builtin and base optionsDylan Baker2021-01-041-4/+2
| | | | | | | | I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
* use OptionKey for compiler_optionsDylan Baker2021-01-041-2/+1
|
* use OptionKey for backend_optionsDylan Baker2021-01-041-1/+1
|
* use OptionKey for coredata.user_optionsDylan Baker2021-01-041-1/+1
|
* rewrite: fix modified member spellingMarc-André Lureau2020-11-051-10/+10
|
* rewrite: fix function spellingMarc-André Lureau2020-11-051-3/+3
|
* Compiler options per langJohn Ericson2020-04-201-2/+2
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* review: Initial fixupDaniel Mensinger2020-03-021-2/+2
|
* types: Annotate ast/interpreter.pyDaniel Mensinger2020-03-021-3/+3
|
* types: Annotate the AST visitorsDaniel Mensinger2020-03-021-1/+1
|
* types: Annotate mparser.pyDaniel Mensinger2020-03-021-2/+6
| | | | | | This also fixes that the keys in ArgumentNode.kwargs are all of the type BaseNode now. Before this commit, it was possible that both strings and Nodes where used as keys.
* Rename 'subdir' -> 'filename' in location objectsJon Turney2020-02-281-18/+18
|
* Update rewriter for filename in node locationJon Turney2020-02-281-14/+15
|
* types: import typing as T (fixes #6333)Daniel Mensinger2020-01-081-15/+15
|
* lgtm: ignore all safe `__init__ method calls overridden method` warningsDaniel Mensinger2019-12-051-2/+2
|
* lgtm: Fix unused variableDaniel Mensinger2019-12-051-1/+1
|
* Fix typos found by codespellWolfgang Stöggl2019-11-061-6/+6
| | | | - Typos were found by codespell v1.16.0
* Per machine do 'build.' and '' option prefixesJohn Ericson2019-06-051-2/+5
| | | | See the docs/ changes for details.
* rewriter: Fix that default_options would not set the correct idDaniel Mensinger2019-06-051-2/+2
| | | | | | | Currently default_options uses "" for the kwarks id, however this is incorect and it must be "/". Additionally, this error won't be ignored in the future with "--skip" (this is why the tests were passing and this wasn't detected earlier).
* rewriter: optimize the list_to_dict functionDylan Baker2019-04-251-4/+9
| | | | | | | | | This uses an iterator instead of walking a list, which is roughly twice as fast. This also does away with the pre-check on whether the list is valid for converting to a dict, and instead handles the case of an uneven number by catching another exception. This is preferable since it's a fatal error anyway, so avoiding it in the non-fatal case is preferable.
* rewriter: fix error messageDaniel Mensinger2019-04-211-1/+1
|
* rewriter: Renamed _src -> _sourcesDaniel Mensinger2019-03-041-1/+1
|
* rewriter: Make sure variable names are validDaniel Mensinger2019-03-041-5/+9
|
* rewriter: Require '/' for the project IDDaniel Mensinger2019-03-041-1/+1
|
* rewriter: Abort on error by defaultDaniel Mensinger2019-03-041-28/+48
|
* rewriter: Changed line sort keyDaniel Mensinger2019-03-041-1/+1
|
* rewriter: Quiet logging by defaultDaniel Mensinger2019-03-041-1/+7
|
* rewriter: type definition code fixDaniel Mensinger2019-03-041-8/+8
|
* rewriter: Handle duplicate targetDaniel Mensinger2019-03-041-8/+16
|
* rewriter: Dump JSON to stderr instead of stdoutDaniel Mensinger2019-03-041-5/+2
|
* rewriter: Remove command aliasDaniel Mensinger2019-03-041-3/+3
|
* rewriter: Renamed tgt_{add,rm} --> target_{add,rm}Daniel Mensinger2019-03-041-6/+6
|
* rewriter: Enforce an empty project ID stringDaniel Mensinger2019-03-041-0/+2
|
* rewriter: Removed python 3.7 feature required=FalseDaniel Mensinger2019-03-041-1/+6
|
* rewriter: Implemented a CLIDaniel Mensinger2019-03-041-11/+94
|
* rewriter: Removed debug printingDaniel Mensinger2019-03-041-6/+0
|
* rewriter: Type annotation cleanupDaniel Mensinger2019-03-041-37/+37
|
* rewriter: Make sure target sources are relativeDaniel Mensinger2019-03-041-0/+13
|
* rewriter: Sort source files (#5010)Daniel Mensinger2019-03-041-9/+25
| | | | | | | | | | | | | | * rewriter: Sort source files * rewriter: Natural sorting * rewriter: Fix flake8 * rewriter: Fixed sorting * rewriter: Make sorting key more readable * rewriter: Even simpler key
* mintro: Dependencies from sourceDaniel Mensinger2019-03-031-2/+2
|
* rewriter: Use mparser to detect the end of some nodesDaniel Mensinger2019-03-031-29/+6
|
* rewriter: Avoid duplicatesDaniel Mensinger2019-03-021-1/+11
|
* rewriter: Sort dict iterations to fix unit testsDaniel Mensinger2019-02-271-3/+3
|