Skip to content
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

Using sphinx-lint #2200

Closed
JulienPalard opened this issue Nov 14, 2022 · 8 comments
Closed

Using sphinx-lint #2200

JulienPalard opened this issue Nov 14, 2022 · 8 comments
Labels

Comments

@JulienPalard
Copy link
Member

Hi!

I'm developping https://pypi.org/project/sphinx-lint/, and it's now able to lint .po files. We use it on python-docs-fr, it's able to spot many typos, like:

tutorial/controlflow.po:199: missing space before default role: 'ula`!else`'. (missing-space-before-default-role)
tutorial/controlflow.po:135: found an unbalanced inline literal markup. (unbalanced-inline-literals-delimiters)
reference/expressions.po:1960: found an unbalanced inline literal markup. (unbalanced-inline-literals-delimiters)
reference/expressions.po:1960: found an unbalanced inline literal markup. (unbalanced-inline-literals-delimiters)

sphinx-lint show never ever give a false positive (I know, I know, utopia...) but please, please, report any false positive to https://github.com/sphinx-contrib/sphinx-lint/issues if you find one.

@cmaureir
Copy link
Collaborator

thanks for the heads-up, I have been using a local variation of a script we have to check inconsistencies between italics and bold formatting, because we had the bad practice of adding stars around English words. That will certainly solve the same issue and even get more things 👍

@JulienPalard
Copy link
Member Author

sphinx-lint is very Sphinx oriented, not .po file oriented, maybe keeping your script in addition to sphinx-lint may make sense :)

@rtobar
Copy link
Collaborator

rtobar commented Nov 17, 2022

I just run the tool against library/ as a whole and it spit out a loooot of messages, so I thought that maybe it didn't work with our po files. After closer inspecting two of these files I found that they were indeed proper errors, so I went and fixed them for those two files, as a sample: #2205

So it seems like it's working as intended, at least from my initial inspection. I'll leave a suggestion on the issue tracker, but otherwise so far so good.

@rtobar
Copy link
Collaborator

rtobar commented Nov 17, 2022

For reference, I left a suggestion to add the ability to sort output (sphinx-contrib/sphinx-lint#50) and some patches with an initial implementation (sphinx-contrib/sphinx-lint#51).

@rtobar
Copy link
Collaborator

rtobar commented Nov 18, 2022

At the beginning of this exercise there were ~320 linting errors in library/ alone. After #2205 and #2210 there are none, but there are still others across the project:

$> sphinx-lint **/*po | wc -l
186

@rtobar
Copy link
Collaborator

rtobar commented Nov 19, 2022

#2210 now fixes all remaining errors.

Most of the errors were due to double backticks not being properly separated from their surrounding words, or being imbalanced. Other common mistake was missing the final _ after hyperlinks. Overall it was a good exercise, and it'd be great to have this tool running as part of the automatic tests.

Fixing these issues also let pospell find two new problems. Most importantly, it found an error that was due to a backtick not separated with spaces from its previous word, which sphinx-lint didn't find. The sentence had this form: some words *with stars*``backtick-words``, so I'm guessing the sphinx-lint check didn't catch that one.

cmaureir pushed a commit that referenced this issue Nov 19, 2022
Este commit contiene el resto de arreglos necesarios para que
sphinx-lint no arroje errores al revisar los archivos de todo el
proyecto.

Relacionado a #2200 .


Signed-off-by: Rodrigo Tobar <[email protected]>
@github-actions
Copy link

Este issue lleva un tiempo sin actualizaciones. ¿Estás trabajando todavía?\nSi necesitas ayuda 🆘 no dudes en contactarnos en nuestro grupo de Telegram.

@github-actions github-actions bot added the stale label Oct 19, 2023
@rtobar
Copy link
Collaborator

rtobar commented Oct 19, 2023

Closing since we successfully adopted sphinx-lint some time ago, and have been keeping up with newer versions as well.

@rtobar rtobar closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants