-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Add a Linter #494
Comments
Feel free to leave a message if you are interested in this topic. |
sphinx-lint may be a good choice. However, currently it doesn't support the customized checkers that we need for zh-tw translation. I am considering whether we need to fork sphinx-lint for our own development. |
What additional checkers would you like to add? |
Some common mistakes (not limited to):
These features are specific to zh-tw, so I am wondering whether we need to implement this feature for ourselves use. |
This will have to be evaluated on a case-by-case basis, since some of these checkers could be useful for other CJK documentations or other translation projects as well, making them a valuable addition to the project. For checkers that are too specific, a long-term solution would be to add a mechanism to |
Thanks @ezio-melotti's contribution. We now have a basic linter now. Use So far, two files have not passed the linter check:
These seem like false alarms to me. As a workaround, we can exclude these two files from sphinx-lint. In the long term, we still need to understand if we can add any rules to handle this. Next Step: Evaluate if it can be integrated with CI. |
I created two PRs to fix these, which appeared to be actual errors:
If those PRs fix the issues and there are no false positives, I think it can be integrated. Should any false positive pop-up in the future, we can temporarily exclude those files and/or fix |
Yes, that's right. Absolutely, it is much faster and more flexible for check processes development. Note that the current method is still not able to catch all the common mistakes I mentioned in this thread (just like the existing process). Maybe we can explore some ways to add some customized rules specific to CJK text. I will create another ticket for tracking. |
Once linter is integrated with CI. We can close this issue. |
Do you want me to prepare a PR? @mattwang44 also suggested using a pre-commit hook in #496 (review) |
@ezio-melotti Sure. Please help on this. Thank you! |
Currently, sphinx-lint may not fully replace sphinx-build 100%. |
|
Propose to integrate a linter with CI and/or
Makefile
. It would help translators detect common rST syntax errors and focus more on semantics.The text was updated successfully, but these errors were encountered: