mozlint.rst (1376B)
1 MozLint 2 ======= 3 4 Linters are used in mozilla-central to help enforce coding style and avoid bad practices. 5 Due to the wide variety of languages in use, this is not always an easy task. 6 In addition, linters should be runnable from editors, from the command line, from review tools 7 and from continuous integration. It's easy to see how the complexity of running all of these 8 different kinds of linters in all of these different places could quickly balloon out of control. 9 10 ``Mozlint`` is a library that accomplishes several goals: 11 12 1. It provides a standard method for adding new linters to the tree, which can be as easy as 13 defining a config object in a ``.yml`` file. This helps keep lint related code localized, and 14 prevents different teams from coming up with their own unique lint implementations. 15 2. It provides a streamlined interface for running all linters at once. Instead of running N 16 different lint commands to test your patch, a single ``mach lint`` command will automatically run 17 all applicable linters. This means there is a single API surface that other tools can use to 18 invoke linters. 19 3. With a simple taskcluster configuration, Mozlint provides an easy way to execute all these jobs 20 at review phase. 21 22 ``Mozlint`` isn't designed to be used directly by end users. Instead, it can be consumed by things 23 like mach, phabricator and taskcluster.