Improvements to Linting Infrastructure
ahalberstadt at mozilla.com
Fri Aug 18 14:55:09 UTC 2017
There have been a bunch of improvements to our linting infrastructure that
landed in the past couple weeks, so figured I'd give them a brief highlight:
- New --fix argument. Running ./mach lint --fix will best effort fix as
many things as it can in-place. Currently eslint is the only linter to
support it, though bug 1388721
<https://bugzilla.mozilla.org/show_bug.cgi?id=1388721> tracks supporting
it with flake8. Errors that can't be fixed will be printed to stdout like
- New --edit argument. Running ./mach lint --edit will open errors in
your $EDITOR. For most editors, this is very naive (just opens each file
containing errors one at a time). But if using vim (or neovim), this will
open errors in the quickfix list
<http://vimdoc.sourceforge.net/htmldoc/quickfix.html>. You can pass both
--edit and --fix at the same time, in which case errors that can be fixed
automatically will be, and the rest will be opened in your editor.
- Callek added yamllint <https://github.com/adrienverge/yamllint>
linter. Run with ./mach lint -l yaml. If you use yaml, feel free to add
- New compact formatter. This mimics eslint's compact formatter, run
./mach lint -f compact to use it.
- rajk enabled the 'dot-notation' eslint rule across the tree.
- Satvik Daga enabled the 'no-new-wrappers' eslint rule across the tree.
- Luciano I enabled the 'no-whitespace-before-property' eslint rule
across the tree.
- Callek added the ability to list linters. Use ./mach lint --list to
see available linters.
There are also a couple bug fixes:
- dyex fixed it so passing in a non-existent path now errors out rather
than silently passing.
- wpt linter no longer lints every file every time
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the firefox-dev