-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docs: Change --indent-string
's whitespace representation
#9904
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #9904 +/- ##
=======================================
Coverage 95.80% 95.80%
=======================================
Files 174 174
Lines 18918 18918
=======================================
Hits 18124 18124
Misses 794 794
|
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.
Thank you the pull request, there's no need for a changelog here I applied the skip News label :)
@@ -219,11 +219,11 @@ class FormatChecker(BaseTokenChecker, BaseRawFileChecker): | |||
( | |||
"indent-string", | |||
{ | |||
"default": " ", | |||
"default": '" "', |
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.
This change thΓ© default value in the code, it's going to cause problem. There's a mechanism in place to modify the default value for the doc but not the code, see enchent dict of available language for the spell checker or default python interpreter. (On mobile, can't link to the exact place Sorry)
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 see. Yeah, I can see how this might cause a problem.
I'm looking at the arguments for enchant. Is this the one you had in mind?
(
"spelling-dict",
{
"default": "",
"type": "choice",
"metavar": "<dict name>",
"choices": _get_enchant_dict_choices(enchant_dicts),
"help": _get_enchant_dict_help(enchant_dicts, PYENCHANT_AVAILABLE),
},
),
...
I see what's happening here, with functions being passed into choices/help, but the real issue is that default
has to be four spaces,
, exactly to make sure the default remains correct. This means that the value has to be different when interpreted for the conversion to reStructuredText
.
Does adding such functionality sound like a reasonable path forward for this PR?
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.
Back on a PC π I meant this:
pylint/doc/exts/pylint_options.py
Lines 41 to 48 in eb33f8a
DYNAMICALLY_DEFINED_OPTIONS: dict[str, dict[str, str]] = { | |
# Option name, key / values we want to modify | |
"py-version": {"default": "sys.version_info[:2]"}, | |
"spelling-dict": { | |
"choices": "Values from 'enchant.Broker().list_dicts()' depending on your local enchant installation", | |
"help": "Spelling dictionary name. Available dictionaries depends on your local enchant installation", | |
}, | |
} |
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.
Thanks for pointing me to this @Pierre-Sassoulas !!
Been busy with work lately, but I'm hoping to find a little time to test out this change soon. π
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 0e68059 |
Type of Changes
Description
It was noticed that when the
all-options.rst
gets viewed on docs, multiple spaces get compressed into one space. This was occurring both in thehelp
and in thedefault
setting.To get around this in the
help
section, I usedU+2002
, which is an En Space. I'm flexible on which whitespace character to use, provided it remedies any future confusion.For the
default
value, I just left it as a regular space, but added quotation marks so the spacing is clear.Closes #8392