PEP257 - D212, and D213 conflicts?

Root Cause:

As @zachgates points out in the accepted answer, the problem is two mutually exclusive rules. And while his solution works in other linters, it does not resolve the issue in Prospector, which does not support the --ignore flag.

Solution for Prospector Users:

For Prospector specifically, there does not seem to be a command-line way to ignore individual rules. The docs suggest creating a profile file but this is not portable enough for my use case.

The workaround is to select one of the default profiles from the built-in profiles list here.

It turns out the profile called default is smart enough to not try to catch both mutually exclusive errors. I still can't figure out why prospector defaults to a configuration that doesn't have the common sense of it's own built-in profile called default.

Solution:

This should fix your issue if using Prospector:

--profile=default


D212 and D213 are mutually exclusive. You should enable one or none of them. By default, they are both disabled, but if you used the ignore flag, you need to also add them.

Using the ignore flag:

--ignore=D212

Tags:

Python