Fix compiler warnings automatically:
- Prefix unused variables
- Remove unused aliases
- Remove unused imports
Add the following lines to deps()
in mix.exs
:
{:ex_fixer, "~> 1.0.0", only: :dev}
mix fix
--force
Ignore uncommitted changes. Apply changes directly to uncommitted files.
mix fix --force
--dry-run [--output-file] [--input-file]
Run without applying changes, while outputting a replay file that may be edited or reviewed prior to running.
mix fix --dry-run --output-file fix.run
mix fix --dry-run --input-file fix.run
mix fix --only vars --input-file fix.run
--only [vars,imports,aliases]
Apply subset of fixes.
--exclude "a/**,b*/c
Ignore files matching any of the listed globs. You must wrap glob list inside of quotes as we do not currently support parsing an array of files.
--include "glob,glob"
Ignore files matching any of the comma separated globs.
--exclude "glob,glob"
Ignore files matching any of the comma separated globs.
--input-file file
Run input list of fixes from file (generated by dry-run)
--output-file file
Output fix set file. Can be used in conjunction with --dry-run
to review
changes before applying.