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
Deprecate suspicious.py? #86404
Comments
I was not here 21 years ago when it was introduced [1], but according to the commit message it was introduced to find leftover Latex mardown. It tries to find 4 patterns in Sphinx node text (not in raw rst files): ::(?=[^=])| # two :: (but NOT ::=) This one has ~100 false positive in susp-ignored.csv (pypi classifiers, slices, ipv6, ...) :[a-zA-Z][a-zA-Z0-9]+| # :foo This one has ~300 false positive in susp-ignored.csv (slices, C:\, ipv6, ...)
This one has ~20 false positive in susp-ignored.csv (mostly reStructuredText in code-blocks) (?<!\.)\.\.[ \t]*\w+: # .. foo: (but NOT ... else:) This one does not have false positives. The script, on my laptop (with a core i9), is slow (4mn20s), and it's probably way slower on the CI. I tried to search for
Case where it actually helped:
I'd go for enhancing rstlint.py (which is fast, ~1s on my laptop) a bit to try to handle the `.. literalinclude:` missing a `:` errors, and dropping suspicious. So I'd appreciate feedback on this script, did it helped you recently? 1: 700cf28 |
I would love to see this disappear. For me, it has been a recurring time waster. |
If it still does useful checks, we could just limit it to running by release managers during the release manufacturing process; it is already run then. It would still allow for problems to be caught and fixed by the RM prior to release tagging. But I don't have a strong opinion about its overall usefulness. I recall it catching at least one problem in a release I was involved with and that was probably before we had the CI checks. |
Good idea Ned! So proposed plan:
If during a few release, we notice this tool is no loger usefull we'll be able to drop it. If we spot some errors that can be migrated to the rstlint.py we'll do. If this tool is in fact usefull, we'll have to think about it again. |
I'll try to track this closely, the drop of Up to today, no commit has introduced suspicious warnings (0 false positive, 0 false negative). I think I'll soon backport the PR, if no one objects, because the current situation is a bit risky: some PR could get merged to master but fail the tests during the backport. |
Today I spotted one error that suspicious could have spotted:
I'm fixing it in #23800
So I'll doodle around this to see if tools/rstlint.py or Sphinx itself can see the error. |
I created #23802 with a port of the "wrong backtick detector" (at least, one aspect from it) from suspicious to rstlint. I dropped the suspicious check three weeks ago, and found a single committed issue since then, which was fixable (and is fixed) in rstlint, so I'll continue this experience and see where it goes. |
New changeset b973542 by Julien Palard in branch 'master': |
Pablo reenabled the check: commit 20ac347 (upstream/master, master)
|
Background on why I reactivated it: I every single alpha release I had to fix actual documentation errors (no false positives) like the one fixed here: I don't like the check, but the release management team don't like to have to restart the release process just fo fix a bunch of docs issues that should have been detected by the CI. If we remove the fix, we need to coordinate all together because currently the status quo is that the RM team now is responsable of fixing the documentation errors as there are several release tools (and other ones) that depend on this target passing. |
If reactivated, the tool needs to be substantially improved. It is NOT smart. The false positives for slicing and logging examples are unnecessarily annoying. It creates a barrier for people submitting documentation patches. Each of the 367 entries in the susp-ignored file represents wasted time for contributors. Also the CSV format is arcane, hard-to-read, and hard-to-edit. It looks like it was quickly thrown together by someone who didn't care about usability. Perhaps there should be a simpler tools that says, "take this current failure and mark it as a false positive" without trying to be over specific. Mandatory checks with a high false positive rate are an anti-pattern for CI systems. Already we've had one case of a contributor (me) who abandoned a doc patch rather than fight this tooling. |
I agree with all you said, but I am against forcing the release management team to absorb the responsibility of fixing all the errors that the CI didn't catch, real or not. Releasing is already a multi-hour process and having many docs errors and formating mistakes to fix is a toll that should be paid at release time. |
Pablo: "I every single alpha release I had to fix actual documentation errors (no false positives)" I don't get it. Do you mean that the Python release process is blocked by typos in the documentation? Why did you catch them in the release process, and not in the regular Python development workflow? Can't we get the same errors in the regular workflow? I understand that the release process requires no warning from "make suspicious", but as explained in other comments, this tool is not reliable. While it catchs some real bugs, the cost of false positives is too high. Doc/tools/susp-ignored.csv contains 368 lines, IMO it's a sign that this tool either requires a serious reworking, or must be disabled/removed. Doc/tools/extensions/suspicious.py is a CPython specific extension, it's not part of Sphinx. Maybe someone should open a feature request on Sphinx to get a similar feature without false positives (or at least less false positives). |
Because our release tools run suspicious.py and it fails and then we need to manually inspect every single failure and fix it as almost all times there are real positives among them
That's what I did reactivating suspicious.py
Sure, we all agree here. Where it seems that we don't agree is how to proceed. I would be super happy to remove the tool if is agreed everywhere, including with the rest of release managers. |
Julien Palard is working actively on the Python documentation. He is the one who removed suspicious "from the CI and docs builds". I trust his judgment here. I suggest to remove it again from there *and* from the release scripts. |
I wrote a PR to enhance -W option documentation. The suspicious job complains whereas my Sphinx format is valid: The full form of argument is::
Example of suspicious error: [using/cmdline:438] ":message" found in "action:message:category:module:lineno" I see that Doc/tools/suspicious.csv already contains an ignore rule for Doc/using/cmdline.rst. |
This extension was written by Gabriel Genellina in 2009 when he discovered that: Several documents contain invalid reST markup that "leaks" Extension added in bpo-4811 with: commit 700cf28
The code didn't evolved much since it was added in 2009. Main changes. commit 144c269
commit 14b5a4d
Filename renamed:
|
I should have monitored this more closely, I started monitoring it weekly, then life got over until today when I'm even surprised to see activity on the issue, sry! (Surprise leading me to investigate why I had not received notifications from bpo, leading me to a bug in my sieve filter...) I counted, during your releases
if I missed none, the success ratio is not good (which is already known). What I'm aiming to do in this issue is to list the true positives over time, by passing the tool manually from time to time, to try to see what kind of rule is usefull in such a tool, and ultimately try to spot those errors in a reliable way. I'd go for removing it from both release process and the CI, this would lower pressure on RMs and contributors, while easing the study of the tool in this issue. I even consider removing it from the Makefile / tools hierarchy to ensure nobody runs it, because if someone run it locally during its contribution process it may hide true positives from me (leading me to think there's no true positives and the tool is useless). |
At least, I would suggest to remove it from the release process. If some people working on the documentation want to keep the tool, maybe it can be an optional CI job? IMO the problem is that currently, it's part of a single "Documentation" job. I don't recall if it's mandatory or not. Also, we need maybe more explanation in the CI job result how to mark false positives. |
Spotted a true positive in b19f455:
(I'm trying to build a true positive list, to have usefull cases where suspicious is usefull, so in the long term I can maybe implement those cases in rslint instead.) |
The previous one could probably be implemented in rstlint using (an equivalent of):
Maybe specialized to known roles, like the script specializes to known directives. |
Another one \o/ Fix in: #27238 It is:
Detected by make suspicious as:
I added a test in the same PR to spot this one in rstlint. |
10 false positives today, see: https://github.com/python/cpython/pull/27945/files I think I now need to put a deadline on this issue, let's say: one year without true positives and I drop it, so 2021-07-19 for now. (In the meantime, I continue to convert each true positives to rstlint, I converted 3 of them so far.) |
A new false positive in b48ac6f:
It's been only one month since the last true positive, so I'll still watching this closely... |
Another true positive for make suspicious:
I'm working on implementing it on rstlint, in the meantime I opened: => #30149 to fix this occurrence. This show that the current version of rstlint catches two mores \o/ |
I slowly started to work on rstlint in its own tree because working in a single file felt inconfortable. The more I advanced in this direction the more it made sense to me:
It currently looks like this: https://github.com/JulienPalard/sphinxlint but should obviously be moved to github.com/python/ if we adopt this direction. So what do you think? (cc Georg as the main author of the script) If so I'd also like to rename the thing, it's currently named |
You gave me a small shock, but I checked and it was only 11/12 years ago :D I'm fine with moving this out of tree; please coordinate with the Sphinx maintainers whether it should be an "official" extension or completely separate. |
IMO moving this small script into the separated project https://github.com/JulienPalard/sphinxlint will help people who are not core developers to contribute and it makes the tool usable by projects outside CPython. So yeah, it's a good thing! Also, it's more convenient to add tests, put it on PyPI, etc. |
If you want to move the project under the https://github.com/psf/ organization, the PSF has some rules to move a project in the Python organization. For example, contributors must respect the PSF Code of Conduct and the GitHub project must have at least 3 administrators. I forgot when I read these rule exactly. See for example https://github.com/psf/pyperf/
|
HAha! Either I misstyped 12 as 21, either I'm bad at math, sorry for the shock ;)
They propose [1] to have it in sphinx-contrib ("A collection of Sphinx extensions maintained by their respective authors. It is not an official part of Sphinx."), what do you think? |
Sure! |
OK, we have: https://github.com/sphinx-contrib/sphinx-lint Ping me if you want rights :) |
Georg, I was able to move forward: Does everything looks good to you? Next step would be to remove rstlint.py from Docs/tools and add a dependency to rstlint from the Makefile (for make check), so the CI uses sphinx-lint. |
Looks good. I should have rights automatically for everything in that org. |
Congrats :-) |
News: Hitting 3 months without a true positive from Also sphinxlint attracted some contributors [1] \o/ |
One true positive today: #32355 |
(cherry picked from commit bc3b31e) Co-authored-by: Julien Palard <julien@palard.fr>
(cherry picked from commit bc3b31ea776ecb7088c8c2acd121499be8e8638b) Co-authored-by: Julien Palard <julien@palard.fr>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: