Skip to content

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

Closed
picnixz wants to merge 32 commits into
python:mainfrom
picnixz:tools/refcounts/lint-127443
Closed

gh-127443: add tool for linting Doc/data/refcounts.dat#127476
picnixz wants to merge 32 commits into
python:mainfrom
picnixz:tools/refcounts/lint-127443

Conversation

@picnixz

@picnixz picnixz commented Dec 1, 2024

Copy link
Copy Markdown
Member

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
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/.ruff.toml Outdated
Comment thread Tools/refcounts/mypy.ini Outdated
Comment thread Tools/refcounts/.ruff.toml Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Tools/refcounts/.ruff.toml Outdated
@picnixz

picnixz commented Dec 2, 2024

Copy link
Copy Markdown
Member Author

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
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread Tools/refcounts/lint.py Outdated
Comment thread .github/workflows/mypy.yml
Comment thread Tools/refcounts/lint.py Outdated
@picnixz picnixz added the stale Stale PR or inactive for long period of time. label Mar 31, 2025
@picnixz

picnixz commented Mar 31, 2025

Copy link
Copy Markdown
Member Author

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
@picnixz

picnixz commented Feb 7, 2026

Copy link
Copy Markdown
Member Author

Considering I haven't been able to work on this one since last year, I'm going to close it. I think @ZeroIntensity wanted to do a similar work so I'll let him do it.

@picnixz picnixz closed this Feb 7, 2026
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