summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
Commit message (Collapse)AuthorAgeFilesLines
* gh-104683: Argument Clinic: Extract parse function name helper (#107964)Erlend E. Aasland2023-08-161-32/+29
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-107972: Argument Clinic: Ensure a C basename is provided after 'as' (#107973)Erlend E. Aasland2023-08-151-3/+6
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-107880: Argument Clinic: Fix regression in gh-107885 (#107974)Erlend E. Aasland2023-08-151-14/+19
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-107880: Teach Argument Clinic to clone __init__ and __new__ methods (#107885)Erlend E. Aasland2023-08-131-7/+19
|
* gh-107883: Argument Clinic: Handle full module/class path in ↵Erlend E. Aasland2023-08-121-3/+10
| | | | | Function.fulldisplayname (#107884) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-95065: Produce nicer deprecation messages in Argument Clinic (#107808)Erlend E. Aasland2023-08-091-17/+19
|
* gh-104683: Argument Clinic: Params now render their own docstrings (#107790)Erlend E. Aasland2023-08-091-16/+11
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Remove unused variables from `Tools/clinic` and tests for ↵Alex Waygood2023-08-091-1/+1
| | | | `Tools/clinic` (#107771)
* gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring ↵Erlend E. Aasland2023-08-091-0/+5
| | | | | limitation (#107764) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Argument Clinic: refactor format_docstring() (#107623)Erlend E. Aasland2023-08-081-46/+36
| | | | | | | Extract helper methods for formatting the signature and parameter sections, and clean up the remaining function body. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-104683: Add --exclude option to Argument Clinic CLI (#107770)Erlend E. Aasland2023-08-081-0/+11
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-106368: Argument clinic: add tests for more failure paths (#107731)Alex Waygood2023-08-081-2/+3
|
* gh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766)Erlend E. Aasland2023-08-081-0/+1
|
* gh-95065: Make Argument Clinic append deprecation warnings to docstrings ↵Erlend E. Aasland2023-08-081-0/+6
| | | | (#107745)
* gh-86457: Fix signature for code.replace() (GH-23199)Serhiy Storchaka2023-08-071-124/+133
| | | | Also add support of @text_signature in Argument Clinic.
* gh-95065: Argument Clinic: Pretty-print long C strings in generated code ↵Erlend E. Aasland2023-08-071-7/+30
| | | | | (#107712) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-107713: Reduce usage of mocks in `test_clinic.py` (#107714)Alex Waygood2023-08-071-0/+3
|
* gh-95065: Add Argument Clinic support for deprecating positional use of ↵Erlend E. Aasland2023-08-071-13/+154
| | | | | | | | | | parameters (#95151) It is now possible to deprecate passing parameters positionally with Argument Clinic, using the new '* [from X.Y]' syntax. (To be read as "keyword-only from Python version X.Y") Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-106368: Improve coverage reports for argument clinic (#107693)Alex Waygood2023-08-062-6/+15
|
* gh-104683: Improve consistency and test coverage of argument-clinic ↵Alex Waygood2023-08-052-10/+17
| | | | `__repr__` functions (#107667)
* gh-106368: Argument clinic: improve coverage for `self.valid_line()` calls ↵Alex Waygood2023-08-041-3/+1
| | | | (#107641)
* gh-104683: Argument Clinic: Use CConverter.length_name where possible (#107638)Erlend E. Aasland2023-08-041-15/+15
| | | | | Also make it a cached property. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104146: Argument clinic: remove dead code highlighted by the `vulture` ↵Alex Waygood2023-08-041-15/+11
| | | | tool (#107632)
* gh-104146: Argument clinic: Remove dead code flagged by mypy's `truthy-bool` ↵Alex Waygood2023-08-042-7/+3
| | | | check (#107627)
* gh-107614: Normalise Argument Clinic error messages (#107615)Erlend E. Aasland2023-08-041-76/+108
| | | | | | | | - always wrap the offending line, token, or name in quotes - in most cases, put the entire error message on one line Added tests for uncovered branches that were touched by this PR. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-107609: Fix duplicate module check in Argument Clinic (#107610)Erlend E. Aasland2023-08-041-1/+1
| | | Also remove duplicate module def from _testcapi.
* gh-104146: Argument clinic: remove unused methods and variables (#107608)Alex Waygood2023-08-042-23/+5
|
* gh-104683: Rework Argument Clinic error handling (#107551)Erlend E. Aasland2023-08-031-26/+43
| | | | | | | | | | | | Introduce ClinicError, and use it in fail(). The CLI runs main(), catches ClinicError, formats the error message, prints to stderr and exits with an error. As a side effect, this refactor greatly improves the accuracy of reported line numbers in case of error. Also, adapt the test suite to work with ClinicError. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Make Argument Clinic template strings class level members (#107556)Erlend E. Aasland2023-08-021-71/+69
| | | | | The motivation for this change is to clean up the output_templates() method a little bit, as it accounts for ~10% of the lines of code in clinic.py; removing some clutter helps readability.
* gh-107559: Argument Clinic: complain about non-ASCII chars in param ↵Erlend E. Aasland2023-08-021-3/+5
| | | | | | | | docstrings (#107560) Previously, only function docstrings were checked for non-ASCII characters. Also, improve the warn() message. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104146: Remove dead code from Argument Clinic (#107555)Erlend E. Aasland2023-08-022-5/+0
|
* gh-104683: Argument Clinic: Refactor and simplify 'add docstring' states ↵Erlend E. Aasland2023-08-011-32/+23
| | | | | | | | | (#107550) Introduce docstring_append() helper, and use it for both parameter and function docstrings. Remove docstring fixup from do_post_block_processing_cleanup(); instead, make sure no fixup is needed. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104683: Argument clinic: cleanup `DLSParser` `state_foo` methods (#107543)Alex Waygood2023-08-011-22/+11
|
* gh-104683: Argument clinic: remove the `LandMine` class (#107541)Alex Waygood2023-08-011-21/+20
|
* gh-107467: Restructure Argument Clinic command-line interface (#107469)Erlend E. Aasland2023-08-011-25/+22
| | | | | | | - Use ArgumentParser.error() to handle CLI errors - Put the entire CLI in main() - Rework ClinicExternalTest to call main() instead of using subprocesses Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
* gh-104683: Argument clinic: pass `clinic` as a parameter where possible ↵Alex Waygood2023-07-291-4/+4
| | | | (#107435)
* gh-104683: Argument clinic: Make the `filename` parameter to `Clinic` ↵Alex Waygood2023-07-291-2/+1
| | | | required (#107439)
* gh-104050: Argument clinic: enable mypy's `--warn-return-any` setting (#107405)Alex Waygood2023-07-292-7/+5
|
* gh-104050: Argument clinic: complete type annotations (#107399)Alex Waygood2023-07-282-18/+24
|
* gh-106368: Argument clinic: Fix minor bug in `state_modulename_name` (#107387)Alex Waygood2023-07-281-5/+3
|
* gh-104683: Argument clinic: cleanup `state_modulename_name()` (#107340)Alex Waygood2023-07-271-10/+9
|
* Docs: Argument Clinic: Restructure "Basic concepts and usage" (#106981)Erlend E. Aasland2023-07-261-7/+13
| | | | | | | | | | | | | | Split "Basic concepts and usage" into: - Reference - Terminology - CLI reference - Background - Basic concepts Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-104050: Argument clinic: Annotate `str_converter_key()` (#107294)Alex Waygood2023-07-261-2/+6
|
* gh-104050: Argument clinic: Complete `get_destination_buffer` annotations ↵Alex Waygood2023-07-261-2/+2
| | | | (#107293)
* gh-104683: Argument Clinic: Make most arguments to `Class` and `Function` ↵Alex Waygood2023-07-261-15/+10
| | | | required (#107289)
* gh-104050: Argument clinic: improve typing around `parse_arg()` methods ↵Alex Waygood2023-07-261-24/+24
| | | | (#107288)
* gh-104050: Argument clinic: annotate `post_parsing()` and `cleanup()` (#107225)Alex Waygood2023-07-251-3/+7
|
* gh-104050: Argument clinic: more misc typing improvements (#107264)Alex Waygood2023-07-251-6/+11
|
* gh-104050: Argument clinic: more misc typing coverage improvements (#107210)Alex Waygood2023-07-251-11/+18
|
* gh-104050: Argument clinic: improve typing around adding C converters (#107209)Alex Waygood2023-07-251-7/+13
|