gecko-dev/python/mozlint/test
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
..
files
filter 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
linters Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
__init__.py
conftest.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
python.ini Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
runcli.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_cli.py Bug 1585686 - [mozlint] Avoid UnicodeEncodeError for users who have an 'ascii' locale r=gbrown 2019-10-03 13:17:08 +00:00
test_editor.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_formatters.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_parser.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_pathutils.py 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_result.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_roller.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00
test_types.py Bug 1580280 - [mozlint] Run |mach lint| with Python 3 and drop support for Python 2 r=mars 2019-09-30 15:09:41 +00:00