summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/android-format.rst
blob: ed23ac64de6386e7a7e14d20ac4b2ba9bfc27377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Spotless
========

`Spotless <https://github.com/diffplug/spotless>`__ is a pluggable formatter
for Gradle and Android.

In our current configuration, Spotless includes the
`Google Java Format plug-in <https://github.com/google/google-java-format>`__
which formats all our Java code using the Google Java coding style guidelines,
and `ktlint <https://ktlint.github.io/>`__ which formats all
our Kotlin code using the official Kotlin coding convention and Android Kotlin
Style Guide.


Run Locally
-----------

The mozlint integration of spotless can be run using mach:

.. parsed-literal::

    $ mach lint --linter android-format

Alternatively, omit the ``--linter android-format`` and run all configured linters, which will include
spotless.


Autofix
-------

The spotless linter provides a ``--fix`` option.