mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 14:45:29 +08:00
purs-tidy for PureScript (#3863)
* purs-tidy * update email address for toastal
This commit is contained in:
@@ -301,6 +301,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Refactor Haskell files with stylish-haskell.',
|
||||
\ },
|
||||
\ 'purs-tidy': {
|
||||
\ 'function': 'ale#fixers#purs_tidy#Fix',
|
||||
\ 'suggested_filetypes': ['purescript'],
|
||||
\ 'description': 'Format PureScript files with purs-tidy.',
|
||||
\ },
|
||||
\ 'purty': {
|
||||
\ 'function': 'ale#fixers#purty#Fix',
|
||||
\ 'suggested_filetypes': ['purescript'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" Description: Dhall’s built-in formatter
|
||||
"
|
||||
function! ale#fixers#dhall_format#Fix(buffer) abort
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" Description: Dhall's package freezing
|
||||
|
||||
call ale#Set('dhall_freeze_options', '')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" Author: toastal <toastal@protonmail.com>
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" Description: Dhall’s built-in linter/formatter
|
||||
|
||||
function! ale#fixers#dhall_lint#Fix(buffer) abort
|
||||
|
||||
26
autoload/ale/fixers/purs_tidy.vim
Normal file
26
autoload/ale/fixers/purs_tidy.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Author: toastal <toastal@posteo.net>
|
||||
" Description: Integration of purs-tidy with ALE.
|
||||
|
||||
call ale#Set('purescript_tidy_executable', 'purs-tidy')
|
||||
call ale#Set('purescript_tidy_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('purescript_tidy_options', '')
|
||||
|
||||
function! ale#fixers#purs_tidy#GetExecutable(buffer) abort
|
||||
return ale#path#FindExecutable(a:buffer, 'purescript_tidy', [
|
||||
\ 'node_modules/purescript-tidy/bin/index.js',
|
||||
\ 'node_modules/.bin/purs-tidy',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#purs_tidy#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#purs_tidy#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'purescript_tidy_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ' %s',
|
||||
\ 'read_temporary_file': 0,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user