8000 WIP: allow checking po files by jeanas · Pull Request #11 · sphinx-contrib/sphinx-lint · GitHub
[go: up one dir, main page]

Skip to content

< 8000 bdi class="js-issue-title markdown-title">WIP: allow checking po files #11

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

Closed
wants to merge 1 commit into from
Closed

WIP: allow checking po files #11

wants to merge 1 commit into from

Conversation

jeanas
Copy link
Contributor
@jeanas jeanas commented Feb 23, 2022

TODO: tests

This finds almost 100 issues in python-docs-fr, mostly about usage of the default role.

Open question is whether polib should be an optional dependency.

@jeanas
Copy link
Contributor Author
jeanas commented Feb 24, 2022

python/python-docs-fr#1824 fixes most of these issues in python-docs-fr.

@JulienPalard
Copy link
Collaborator

Open question is whether polib should be an optional dependency.

I think so, as it's clearly not the main use of sphinx-lint.

We'll just have to write a nice warning message like "Skipping po file: please install sphinx-lint[po] if you want for sphinx-lint to check them too", because it could happen that a po file is in the checked tree, I don't want sphinx-lint to exit(1) in this case. I think I would enjoy having the error being printed like any other errors, "on line 1", so it can even be read from the IDE if someone uses sphinx-lint from an IDE.

Copy link
Collaborator
@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

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

This seems a useful feature -- I was just looking into linting some of the CPython translations --, however I think it would be better to make it optional and hide it behind an explicit flag, e.g. --check-po-files.

If the flag is specified it could check if polib is installed and give an error if it isn't. If it's installed it can include .po files in the check.

Regarding the implementation I think it would be better if there was a bit less coupling, but that will likely make the PR more complex. Since there probably aren't many other file types we want to check, then I'd say the current implementation is ok -- we can always refactor later if we add more file types.

@jeanas
Copy link
Contributor Author
jeanas commented Jun 23, 2022

I'm a bit short on time right now. I hope to pick this up, but it might not be very soon. (But feel free to beat me to it.)

@JulienPalard
Copy link
Collaborator

I've "merged" your PR, with a slightly different approch as the code has evolved a lot since then.

Thanks for the PR, the idea, and the initial implementation!!

@jeanas jeanas deleted the po branch October 18, 2022 10:16
@jeanas
Copy link
Contributor Author
jeanas commented Oct 18, 2022

Thanks @JulienPalard!

@JulienPalard
Copy link
Collaborator

@jean-abou-samra I'm fixing those found in python-docs-fr and will open a PR to add sphinx-lint to the CI of python-docs-fr (and propose it to other translations).

@jeanas
Copy link
Contributor Author
jeanas commented Oct 18, 2022

SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0