Commit Graph

70 Commits

Author SHA1 Message Date
Marc-André Lureau 7ba7ea0897 rewrite: fix function spelling 2020-11-05 21:22:14 +02:00
John Ericson 278c294aa4 Compiler options per lang
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`.
2020-04-20 23:23:15 +03:00
Daniel Mensinger ab988198c7
review: Initial fixup 2020-03-02 10:47:20 +01:00
Daniel Mensinger c48b0dea27
types: Annotate ast/interpreter.py 2020-03-02 10:34:55 +01:00
Daniel Mensinger a75255bc4c
types: Annotate the AST visitors 2020-03-02 10:34:55 +01:00
Daniel Mensinger c14aea2812
types: Annotate mparser.py
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.
2020-03-02 10:34:55 +01:00
Jon Turney c8f8d58273
Rename 'subdir' -> 'filename' in location objects 2020-02-28 11:54:08 +00:00
Jon Turney d1bd4ccf6e
Update rewriter for filename in node location 2020-02-28 11:54:05 +00:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Daniel Mensinger b5cec1c632 lgtm: ignore all safe `__init__ method calls overridden method` warnings 2019-12-05 00:22:10 +02:00
Daniel Mensinger fa4de71faf lgtm: Fix unused variable 2019-12-05 00:22:10 +02:00
Wolfgang Stöggl f037e7ef45 Fix typos found by codespell
- Typos were found by codespell v1.16.0
2019-11-06 09:55:30 -05:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Daniel Mensinger 94c6da33a7 rewriter: Fix that default_options would not set the correct id
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).
2019-06-05 22:27:32 +03:00
Dylan Baker 8e1670cc60 rewriter: optimize the list_to_dict function
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.
2019-04-25 12:28:51 -07:00
Daniel Mensinger bffd28d4b2 rewriter: fix error message 2019-04-21 22:15:27 +03:00
Daniel Mensinger 5f6b94ccb9
rewriter: Renamed _src -> _sources 2019-03-04 13:00:31 +01:00
Daniel Mensinger 617445ea72
rewriter: Make sure variable names are valid 2019-03-04 13:00:31 +01:00
Daniel Mensinger 594bf678c7
rewriter: Require '/' for the project ID 2019-03-04 13:00:30 +01:00
Daniel Mensinger 609a21ff9f
rewriter: Abort on error by default 2019-03-04 13:00:30 +01:00
Daniel Mensinger c957a2aa94
rewriter: Changed line sort key 2019-03-04 13:00:30 +01:00
Daniel Mensinger 5d2f14fce7
rewriter: Quiet logging by default 2019-03-04 13:00:30 +01:00
Daniel Mensinger 06695fec60
rewriter: type definition code fix 2019-03-04 13:00:29 +01:00
Daniel Mensinger e724fd5438
rewriter: Handle duplicate target 2019-03-04 13:00:29 +01:00
Daniel Mensinger b55dbf0fae
rewriter: Dump JSON to stderr instead of stdout 2019-03-04 13:00:07 +01:00
Daniel Mensinger 90b557e38a
rewriter: Remove command alias 2019-03-04 13:00:07 +01:00
Daniel Mensinger 1290330894
rewriter: Renamed tgt_{add,rm} --> target_{add,rm} 2019-03-04 13:00:06 +01:00
Daniel Mensinger eabc35340d
rewriter: Enforce an empty project ID string 2019-03-04 13:00:06 +01:00
Daniel Mensinger 8fad06e8c8
rewriter: Removed python 3.7 feature required=False 2019-03-04 13:00:06 +01:00
Daniel Mensinger 740f6b8f06
rewriter: Implemented a CLI 2019-03-04 13:00:05 +01:00
Daniel Mensinger e72f535fc8
rewriter: Removed debug printing 2019-03-04 13:00:05 +01:00
Daniel Mensinger 0fd4dce906
rewriter: Type annotation cleanup 2019-03-04 13:00:05 +01:00
Daniel Mensinger 2582f311b0
rewriter: Make sure target sources are relative 2019-03-04 13:00:05 +01:00
Daniel Mensinger 760d1bff9c rewriter: Sort source files (#5010)
* rewriter: Sort source files

* rewriter: Natural sorting

* rewriter: Fix flake8

* rewriter: Fixed sorting

* rewriter: Make sorting key more readable

* rewriter: Even simpler key
2019-03-04 13:58:35 +02:00
Daniel Mensinger f9b41d5ecb
mintro: Dependencies from source 2019-03-03 23:19:03 +01:00
Daniel Mensinger 5a22bb7901 rewriter: Use mparser to detect the end of some nodes 2019-03-03 13:57:25 +02:00
Daniel Mensinger 7199cd2095 rewriter: Avoid duplicates 2019-03-02 17:05:10 +02:00
Daniel Mensinger 94fe01deec rewriter: Sort dict iterations to fix unit tests 2019-02-27 19:59:58 +02:00
Daniel Mensinger 9e247cb52e
rewriter: Set and delete default options 2019-02-26 09:34:58 +01:00
Daniel Mensinger 74bb79e26e
rewriter: Remove matching regex from list 2019-02-26 09:34:57 +01:00
Daniel Mensinger e37d32aa9d
rewriter: Basic default_options support 2019-02-26 09:34:57 +01:00
Daniel Mensinger 4b7b5a7185
Fixed flake8 2019-02-16 14:17:02 +01:00
Daniel Mensinger 631dbc4b24
Fixed indentation 2019-02-16 14:17:02 +01:00
Daniel Mensinger 5184465280
rewriter: Added support for adding targets 2019-02-16 14:17:01 +01:00
Daniel Mensinger 056c533ede
rewriter: Added support for removing targets 2019-02-16 14:14:16 +01:00
Daniel Mensinger 24a2cf02e2
Can now find the assignment node of a value 2019-02-16 14:10:08 +01:00
Daniel Mensinger 0ce02b57d7
Renamed type classes 2019-02-10 16:13:53 +01:00
Daniel Mensinger 8c364952af
Added dependecy kwargs support 2019-01-31 15:57:02 +01:00
Daniel Mensinger 5655865246
Added test case 2019-01-31 15:43:04 +01:00
Daniel Mensinger c64d80cf2f
Renamed operation test -> info 2019-01-31 15:43:04 +01:00