Add support for SwiftFormat as a fixer

SwiftFormat is a tool that can be used to format Swift files. This commit adds
support for using SwiftFormat as a fixer from ALE. It looks for executables in
the Pods directory, then the Pods directory for a React Native project, then
finally falls back to the globally installed instance if neither of those were
found.

https://github.com/nicklockwood/SwiftFormat
This commit is contained in:
Gordon Fontenot
2017-08-09 12:26:38 -05:00
parent 2b546a50dc
commit 4709e67627
6 changed files with 70 additions and 2 deletions
+5
View File
@@ -72,6 +72,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['css', 'sass', 'scss', 'stylus'],
\ 'description': 'Fix stylesheet files using stylelint --fix.',
\ },
\ 'swiftformat': {
\ 'function': 'ale#fixers#swiftformat#Fix',
\ 'suggested_filetypes': ['swift'],
\ 'description': 'Apply SwiftFormat to a file.',
\ },
\}
" Reset the function registry to the default entries.