-
-
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
Add keyword-argument to no-space-check option #1368
Comments
Its implementation should be easily done by adding a condition there: # UNTESTED
if _KEYWORD_ARGUMENT in self.config.no_space_check:
self._check_space(tokens, i, (_IGNORE, _IGNORE))
else:
self._check_space(tokens, i, (_MUST_NOT, _MUST_NOT)) I might make a fork-and-pull-request myself if I find the time to do it properly. |
|
I can only find mention of Now I have to run my source files with |
Hello, @bertsky , The PR linked in the issue show the actual removal of the no-space-check option https://github.com/PyCQA/pylint/pull/3577/files#diff-89a2fba770c65703addbc42a471241e0L340 as well as the discussion of why we removed it in the issue linked. To sumup, we removed bad-whitespace mainly because it had a huge maintenance cost and because tons of tool handle this well (black in particular). For your actual problem, if you really want to copy-paste into the interpreter while keeping that old pep8 rule; I would advise to remove the empty lines, keep the old version of pylint, or create a fork. |
Hi @Pierre-Sassoulas, Sorry, I missed that second related PR. IIUC you advise to use code formatters to preprocess the source (before pylint gets to see it) – right? (Or is it the other way round – you expect source files to adhere to your conventions strictly, and advise code formatters to generate representations for the human eye?)
I usually use pylint as part of CI, so neither holding pylint at the old version nor forking appear very attractive. Pasting into the interpreter is a rather casual use-case for me (I just brought it up for completeness). My sources are mostly following that old convention, and my editor uses it. So you recommend reformatting sources (e.g. with |
Yes, I strongly advise to not bother with manual formatting at all and let black, isort, and pre-commit, unimport and probably others do the hard boring work automatically before using pylint. It permits to remove all formatting checks from pylint and other checkers like flake8. Those check won't fail after that, or should not fail.
See also http://pylint.pycqa.org/en/latest/faq.html#i-am-using-another-popular-linter-alongside-pylint-which-messages-should-i-disable-to-avoid-duplicates for pylint configuration for cohabitation with other checkers. |
This is a feature request.
Currently "no-space-check" option accepts "dict-separator" to allow spaces beside ":"
How about to allow spaces for keyword arguments?
Then the user won't need to disable entire "bad-whitespace" if they want to allow spaces between "=" for keyword arguments.
pylint --version output
The text was updated successfully, but these errors were encountered: