forked from mirrors/gecko-dev
		
	 1756e8266e
			
		
	
	
		1756e8266e
		
	
	
	
	
		
			
			Android-component and Fenix use ktlint, so mozilla-central should use same tools via spotless. This is from https://phabricator.services.mozilla.com/D131018 Differential Revision: https://phabricator.services.mozilla.com/D161557
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			813 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			813 B
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
| 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.
 |