gecko-dev/python/mozlint
Andrew Halberstadt 0f4437d7d5 Bug 1608783 - [mozlint] Fix bug in 'collapse' when two paths are a prefix of one another, r=Standard8
This was happening because we had two exclude paths that were run through the 'collapse' algorithm:
editor/libeditor/tests/browserscope/lib/richtext
editor/libeditor/tests/browserscope/lib/richtext2

The problem was that in order to determine the base directory, the algorithm called
'os.path.commonprefix'. This function just returns the common string prefix, which
is the '.../lib/richtext' path. Even though in the above, the base *should* have
been '.../lib'.

To fix the problem, we add a check to ensure the computed base doesn't have any
sibling directories with the same prefix. If there are, it means 'commonprefix' was
too greedy.

Differential Revision: https://phabricator.services.mozilla.com/D60173

--HG--
extra : moz-landing-system : lando
2020-01-17 16:18:59 +00:00
..
mozlint Bug 1608783 - [mozlint] Fix bug in 'collapse' when two paths are a prefix of one another, r=Standard8 2020-01-17 16:18:59 +00:00
test Bug 1608783 - [mozlint] Fix bug in 'collapse' when two paths are a prefix of one another, r=Standard8 2020-01-17 16:18:59 +00:00
setup.py Bug 1589056 - [mozlog] Update mozlog version number to 5.0 r=jgraham 2019-10-24 14:12:32 +00:00