This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Update patchcheck to looks for files with clinic comments
Type: enhancement Stage: patch review
Components: Argument Clinic, Build Versions: Python 3.4
process
Status: open Resolution:
Dependencies: 20326 Superseder:
Assigned To: meador.inge Nosy List: ezio.melotti, larry, meador.inge, ncoghlan, pitrou, zach.ware
Priority: normal Keywords: patch

Created on 2014-01-15 03:12 by meador.inge, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
patchcheck-clinic.patch meador.inge, 2014-01-15 03:12 review
detect.py larry, 2014-01-28 08:31 Example script that sanity-checks all Clinic blocks in a file.
Messages (5)
msg208132 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2014-01-15 03:12
It has been noted a few times that someone might forget to re-run
clinic.py after updating the argument clinic comments.  The attached
patch adds a new check to patchcheck.py to note when files containing
argument clinic comments have been changed.  You could take it a step
further and deduce if the lines ranges within the comments were actually
changed, but let's start out simple.
msg208133 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2014-01-15 03:30
This could be taken a step further, following the lead of the whitespace fixing checks and just run clinic on files that need it.
msg209070 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-24 13:36
Maybe I'm not reading this correctly.  It looks like the function returns True if it finds any .c or .h file that contains the string '[clinic input]'.  It doesn't seem to only check files that have changed.

I was considering adding a checkum for the *input* to the third comment (what I call the "output line").  That would let this checker compute the checksum for the input and output sections and confirm that they match.  If the input had changed, the checksum would fail, and you'd know they hadn't run clinic recently.
msg209165 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2014-01-25 08:30
Having clinic work like reindent on "make patchcheck" would be very nice.

As a second line of defence, we should also have a server side equivalent of the whitespace check as a repo hook in Mercurial (i.e. don't allow a push when clinic output is out of date).
msg209511 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-28 08:31
I've attached a script here that uses the new tweaked format of Clinic
blocks.  The new tweaked format isn't checked in yet--that change is being tracked with #20326.

Once that's checked in, though, the attached script will check that both the input and output blocks are unchanged and up-to-date, respectively.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64463
2015-02-25 15:33:37serhiy.storchakasetcomponents: + Argument Clinic
2014-02-15 15:34:13ezio.melottisetnosy: + ezio.melotti
2014-01-28 08:31:56larrysetfiles: + detect.py

dependencies: + Argument Clinic should use a non-error-prone syntax to mark text signatures
messages: + msg209511
2014-01-25 08:30:02ncoghlansetnosy: + pitrou, ncoghlan
messages: + msg209165
2014-01-24 13:36:14larrysetmessages: + msg209070
2014-01-15 03:30:35zach.waresetnosy: + zach.ware
messages: + msg208133
2014-01-15 03:12:39meador.ingecreate