◐ Shell
clean mode source ↗

Add sphinx-lint to the ci workflow and Makefile. by ezio-melotti · Pull Request #496 · python/python-docs-zh-tw

I suggest that we run the lint tool before proceeding with the full HTML build. This way, we can detect any issues earlier.

I now moved this before the validate step in 6f7d53b. I also verified that sphinx-lint is able to detect issues directly in .po files, and even if it needs to convert them to .rst first, the whole process (converting + checking) takes around 10-15s, which is IMHO acceptable.

Also, I am concerned about potential false alarms that may block pull requests.

sphinx-lint only detected 3 errors, and now that I added an additional check (in f257955) it detected 4 additional errors, bringing the total up to 7. This is a pretty low number, which is probably explained by the fact that we also run sphinx-lint on the English CPython docs.

I'm looking at the sphinx.po issues to determine what the problem is. If it turns out there are indeed false positives, we should report and fix them upstream. I can also mark the "Lint" step as optional, so that it doesn't prevent merges if there are failures, but once the false positives are fixed I'd rather keep it as a mandatory step.

I can also prepare another PR to fix all the issues so that we can merge it before this PR.

Finally, in c5462a9, I added a push trigger to CI so that the the workflow is run again as I push more changes. I think it would be good to have it anyway, but since it doesn't actually belong to this PR, I can remove it and possibly add it as a separate PR if you agree on having it.