Checking that a string matches one regex and doesn't match another I'm using pylint and flake8 to control the code quality. However I am in check-mate position, where styling one does not suit the pylint or flake8:

if (not re.search(regexp, summary) and
    not re.search(regexp2, summary)):                   
    return False  


Output from flake8:

visually indented line with same indent as next logical line [E129] 


Moving return is not helping, the previous error still occurs and there is new one thrown by pylint:

if (not re.search(regexp, summary) and
    not re.search(regexp2, summary)):                   
        return False  


Output from pylint:

[bad-indentation] Bad indentation. Found 8 spaces, expected 4
Per PEP-8, you can ("Acceptable options in this situation include, but are not limited to...") further indent the second line of the condition:


# Add some extra indentation on the conditional continuation line.
if (this_is_one_thing
        and that_is_another_thing):
    do_something()



The difference is that indentation in the continuation lines is purely stylistic, whereas indentation of the next code block has semantic meaning. In your case:

if (not re.search(regexp, summary)
        and not re.search(regexp2, summary)):                   
    return False  


Note I have moved the and per the same guidance.