1# Refactoring the platform with lint
2Inspiration: go/refactor-the-platform-with-lint\
3**Special Thanks: brufino@, azharaa@, for the prior work that made this all possible**
4
5## What is this?
6
7It's a python script that runs the framework linter,
8and then (optionally) copies modified files back into the source tree.\
9Why python, you ask?  Because python is cool ¯\_(ツ)_/¯.
10
11Incidentally, this exposes a much simpler way to run individual lint checks
12against individual modules, so it's useful beyond applying fixes.
13
14## Why?
15
16Lint is not allowed to modify source files directly via lint's `--apply-suggestions` flag.
17As a compromise, soong zips up the (potentially) modified sources and leaves them in an intermediate
18directory.  This script runs the lint, unpacks those files, and copies them back into the tree.
19
20## How do I run it?
21**WARNING: You probably want to commit/stash any changes to your working tree before doing this...**
22
23```
24source build/envsetup.sh
25lunch cf_x86_64_phone-userdebug # or any lunch target
26m lint_fix
27lint_fix -h
28```
29
30The script's help output explains things that are omitted here.
31