Mark Galeck
Mark Galeck

Reputation: 6385

how do I disable a bogus pylint warning for a multi-line string only

How do I disable a bogus pylint warning for a multiline string just for that string?

The first disable works, the second (bogus warning) does not.

Edited after initial answer for a simpler example.

#!/usr/bin/env python

print 0!= 1 # pylint: disable=C0322
print {''
# pylint: disable=C0322
: '''%      
'''
# pylint: enable=C0322
}

I get

************* Module foobar
C0322:  4: Operator not preceded by a space
print {''

: '''%
     ^

Upvotes: 7

Views: 7131

Answers (1)

Peeyush
Peeyush

Reputation: 726

you can do something like

# pylint: disable=C0322
print 0!= 1
print '''%
'''
# pylint: enable=C0322

Upvotes: 10

Related Questions