Skip to content
Snippets Groups Projects
Commit d02f4b3e authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

match: break boolean expressions into one operand per line

This makes it much easier to spot both the operators ('and'/'or') and
the operands.
parent 475eae34
No related branches found
No related tags found
No related merge requests found
......@@ -225,8 +225,9 @@
if dir in self._excluderoots:
return False
parentdirs = None
if (self._includeroots and dir not in self._includeroots and
dir not in self._includedirs):
if (self._includeroots and
dir not in self._includeroots and
dir not in self._includedirs):
parentdirs = list(util.finddirs(dir))
if not any(parent in self._includeroots for parent in parentdirs):
return False
......@@ -230,8 +231,10 @@
parentdirs = list(util.finddirs(dir))
if not any(parent in self._includeroots for parent in parentdirs):
return False
return (not self._fileroots or '.' in self._fileroots or
dir in self._fileroots or dir in self._dirs or
return (not self._fileroots or
'.' in self._fileroots or
dir in self._fileroots or
dir in self._dirs or
any(parentdir in self._fileroots
for parentdir in parentdirs or util.finddirs(dir)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment