Commit f014783
authored
Point to precise line in parsed source for parsing problems (#10)
* Point to precise line in parsed source for grammar errors
* Refactor to new _get_docstring_node with tests
* Show file & context for unknown doctypes
* Improve escape_qualname
Collapse multiple replaced special chars to one "_" and add doctests.
* Don't prefix with _UnknownName_
Instead just alias to typing.Any. This should make it a bit easier to
addopt docstub gradually.
* Refactor to `doctype_to_annotation`
avoids confusion with the parent classes `transform` method.
* Fix tests for DoctypeTransformer
* Show unknown name in error message
* Don't swallow SystemExit or KeyboardInterrupt
* Expand docstring of accumulate_qualname
* Use bold red to underline reported errors
* Ignore path delimiter in doctest to support Windows
Otherwise, this fails on Windows which returns "file\\with\\..."
* Make arguments to DoctypeTransformer optional
This makes it easier to test the class.
* Test DoctypeTransformer for unknown names
* Use "Any" instead of "_GrammarError_"
* Don't print in DocstringAnnotations if ctx=None
Also add a few tests for that class and remove the currently unused
yields property.
* Add tests for Annotation class
* Extend doctest of ContextFormatter1 parent 376e026 commit f014783
8 files changed
Lines changed: 654 additions & 147 deletions
File tree
- src/docstub
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
0 commit comments