pycodestyle
pycodestyle copied to clipboard
E228: Check only detects missing whitespace around % when both sides are missing
At the moment "sometext %s"%"testing will be detected by E228. This is correct.
At the moment "sometext %s" %"testing will not be detected by E228. This is not correct.
Because of the description of E228 (missing whitespace around modulo operator) the check has to detect missing whitespaces on the left site and on the right site of the modulo operator.
At the moment E228 only detects missing whitespaces on the left site of the modulo operator.
Tested with latest PEP8 version (1.5.7).
% cat testing
"sometext %s"%"testing"
sometext %s" %"testing"
sometext %s" % "testing"
% pep8 --select E228 testing
testing:1:14: E228 missing whitespace around modulo operator
E225 is working like expected:
% pep8 --select E225 testing
testing:2:11: E225 missing whitespace around operator
testing:3:11: E225 missing whitespace around operator