Skip to content

gh-127443: add tool for linting Doc/data/refcounts.dat #127476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Dec 1, 2024

This tool can be used as follows:

python3.12 Tools/refcounts/lint.py  Doc/data/refcounts.dat
python3.12 Tools/refcounts/lint.py  Doc/data/refcounts.dat --abi Misc/stable_abi.toml

With the current file, I have something like: (three were missing in #127451, my bad, so I fixed them as well)

----------------------------------- PARSING ------------------------------------
----------------------------------- CHECKING -----------------------------------
  643  PyErr_NormalizeException[exc]                      missing reference count management
  644  PyErr_NormalizeException[val]                      missing reference count management
  645  PyErr_NormalizeException[tb]                       missing reference count management

Found 3 issues
Entries are not sorted

When I also include the stable ABI file, I have in addition (output truncated)

Found 3 issues
Entries are not sorted
----------------------------- CHECKING STABLE ABI ------------------------------
Stable ABI file: /home/picnix/lib/python/cpython/Misc/stable_abi.toml

Missing 232 stable ABI entries:
PyArg_Parse
PyArg_ParseTuple
PyArg_ParseTupleAndKeywords
PyArg_UnpackTuple
PyArg_VaParse
PyArg_VaParseTupleAndKeywords
PyArg_ValidateKeywordArguments
PyBuffer_FromContiguous
[...]

@picnixz picnixz force-pushed the tools/refcounts/lint-127443 branch from bc45547 to 183388f Compare December 1, 2024 12:29
@picnixz picnixz marked this pull request as ready for review December 2, 2024 11:28
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I haven't reviewed the script as I know nothing about the refcounts.dat file, but the lint configs LGTM.

@picnixz
Copy link
Member Author

picnixz commented Dec 2, 2024

I don't think I'll change the configs. So thanks Alex for your review (and sorry for the request, I misclicked)! Now, I'll wait for Peter and Kirill's reviews concerning the script itself.

@AlexWaygood AlexWaygood removed their request for review December 2, 2024 12:10
@picnixz picnixz added the stale Stale PR or inactive for long period of time. label Mar 31, 2025
@picnixz
Copy link
Member Author

picnixz commented Mar 31, 2025

Marking it as stale because I still didn't have time to work on the project separately (I'm working on it but I'm advancing slowly)

@picnixz picnixz marked this pull request as draft March 31, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants