-
-
Notifications
You must be signed in to change notification settings - Fork 20
Implement --enable and --disable. #27
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
Conversation
6fde792
to
9f575a8
Compare
481f9b4
to
702bc1d
Compare
702bc1d
to
8db6ac9
Compare
Added some tests playing with It does not break our known users (cpython, pandas, sympy, django-oauth-toolkit). But I'll gladly take a review about test names, as they won't be easy to change if people start using them in |
(@jean-abou-samra, @hugovk, @ezio-melotti, @matilda-me pinging you as contributors to this repo, if you have time to review) |
Thanks @jean-abou-samra! Fixed your suggestions. |
Thanks for doing this! I did a quick review and didn't find any issues standing out, even though it's been some time since I tinkered with this script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments, mainly about some implementation details and the names of the checkers.
Regarding the names, the following things should be improved:
- name length (
hyperlinks-missing-underscore-after-closing-backtick
) - consistency (
roles-without-backticks
,directives-missing-colon
,missing-space-after-roles
) - singular vs plural (some checker use
literal
orline
, others useroles
ordirectives
)
(Note that not all my suggestions are consistent, it's a bit tricky to compare the names from the GitHub review UI.)
Once the names are released, it will be difficult to change them, so they must be chosen wisely :)
I would also suggest to check other linters both for their cmd line api, and for checker names:
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor nits and some suggestions that are somewhat unrelated to --enable
/--disable
-- let me know if you want separate issues/PRs for those.
Thanks a lot for the reviews! I took the time to rephrase the checkers according to ezio propositions and for consistency, removed all unneeded plurals (as pylint does) ... :
And :
$ python sphinxlint.py --list --verbose
|
Should |
I think plurals for
Because each instance of these errors concerns multiple backticks. |
Done:
|
@ezio-melotti do you think we can merge and release as is, to unlock python/cpython#92290? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor nits, but otherwise it looks good.
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
Just before being offline for a week, I tried myself at implementing
--enable
to help sphinx-doc/sphinx#10389 (comment).I added a
--list
option:It's usefull to experiment with
--enable
and--disable
:To make it usefull I had to split many functions, which has an impact on performance, but neglictible compared to the usefullness of being able to enable/disable specific checks. On my laptop running pytest goes from
1.460s
to1.565s
(7% slower).