Bug 1626104 - Change mach lint --config-path to be relative to topsrcdir. r=linter-reviewers,ahal

This makes the --config-path option relative to topsrcdir rather then the current
directory.
Using a relative path is difficult for a developer running mach lint locally as
the command has to change as the working directory changes. A stable base path also
facilitates creating an alias in machrc.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2020-03-31 19:41:22 +00:00
Родитель a8e8e4a9b6
Коммит 3b393ab7ea
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -204,6 +204,9 @@ def run(paths, linters, formats, outgoing, workdir, rev, edit,
from mozlint import LintRoller, formatters
from mozlint.editor import edit_issues
lintargs['config_paths'] = [os.path.join(lintargs['root'], p) for p in
lintargs['config_paths']]
if list_linters:
lint_paths = find_linters(lintargs['config_paths'], linters)
linters = [os.path.splitext(os.path.basename(l))[0] for l in lint_paths]