Issue 20264: Update patchcheck to looks for files with clinic comments (original) (raw)

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: Alyssa 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:56 admin set github: 64463
2015-02-25 15:33:37 serhiy.storchaka set components: + Argument Clinic
2014-02-15 15:34:13 ezio.melotti set nosy: + ezio.melotti
2014-01-28 08:31:56 larry set files: + detect.pydependencies: + Argument Clinic should use a non-error-prone syntax to mark text signaturesmessages: +
2014-01-25 08:30:02 ncoghlan set nosy: + pitrou, ncoghlanmessages: +
2014-01-24 13:36:14 larry set messages: +
2014-01-15 03:30:35 zach.ware set nosy: + zach.waremessages: +
2014-01-15 03:12:39 meador.inge create