Close #2281 - Separate cwd commands from commands

Working directories are now set seperately from the commands so they
can later be swapped out when running linters over projects is
supported, and also better support filename mapping for running linters
on other machines in future.
This commit is contained in:
w0rp
2021-03-01 20:11:10 +00:00
parent 48fab99a0a
commit 9fe7b1fe6a
117 changed files with 1142 additions and 1111 deletions
+40 -40
View File
@@ -62,8 +62,8 @@ Execute(--stdin-filepath should be used when prettier is new enough):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --no-semi'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -74,16 +74,16 @@ Execute(The version number should be cached):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --stdin-filepath %s --stdin',
\ }
GivenCommandOutput []
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -95,8 +95,8 @@ Execute(Should set --parser to `babylon` by default, < 1.16.0):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser babylon'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -109,8 +109,8 @@ Execute(Should set --parser to `babel` by default, >= 1.16.0):
GivenCommandOutput ['1.16.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser babel'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -123,8 +123,8 @@ Execute(Should set --parser based on filetype, TypeScript):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser typescript'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -137,8 +137,8 @@ Execute(Should set --parser based on filetype, CSS):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser css'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -151,8 +151,8 @@ Execute(Should set --parser based on filetype, LESS):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser less'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -165,8 +165,8 @@ Execute(Should set --parser based on filetype, SCSS):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser scss'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -179,8 +179,8 @@ Execute(Should set --parser based on filetype, JSON):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser json'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -193,8 +193,8 @@ Execute(Should set --parser based on filetype, JSON5):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser json5'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -207,8 +207,8 @@ Execute(Should set --parser based on filetype, GraphQL):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser graphql'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -221,8 +221,8 @@ Execute(Should set --parser based on filetype, Markdown):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser markdown'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -235,8 +235,8 @@ Execute(Should set --parser based on filetype, Vue):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser vue'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -249,8 +249,8 @@ Execute(Should set --parser based on filetype, YAML):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser yaml'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -263,8 +263,8 @@ Execute(Should set --parser based on filetype, HTML):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser html'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -277,8 +277,8 @@ Execute(Should set --parser based on filetype, Ruby):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser ruby'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -291,8 +291,8 @@ Execute(Should set --parser based on first filetype of multiple filetypes):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser css'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -305,8 +305,8 @@ Execute(Should set --parser for experimental language, Handlebars):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': '%s:h',
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --parser glimmer'
\ . ' --stdin-filepath %s --stdin',
\ }
@@ -317,8 +317,8 @@ Execute(Changes to directory where .prettierignore is found):
GivenCommandOutput ['1.6.0']
AssertFixer
\ {
\ 'command': ale#path#CdString(expand('%:p:h:h'))
\ . ale#Escape(g:ale_javascript_prettier_executable)
\ 'cwd': expand('%:p:h:h'),
\ 'command': ale#Escape(g:ale_javascript_prettier_executable)
\ . ' --stdin-filepath %s --stdin',
\ }