From 42e2d1a664eba26c169f60ea5b0c0d6578ab5d2c Mon Sep 17 00:00:00 2001 From: Arnold Chand Date: Mon, 4 Sep 2023 11:46:56 -0400 Subject: [PATCH] fix(linters): INPUT in quotes, for spc in fs (#73) --- lua/efmls-configs/linters/actionlint.lua | 2 +- lua/efmls-configs/linters/ameba.lua | 2 +- lua/efmls-configs/linters/clang_tidy.lua | 2 +- lua/efmls-configs/linters/clazy.lua | 2 +- lua/efmls-configs/linters/codespell.lua | 2 +- lua/efmls-configs/linters/cppcheck.lua | 2 +- lua/efmls-configs/linters/cpplint.lua | 2 +- lua/efmls-configs/linters/cspell.lua | 2 +- lua/efmls-configs/linters/dartanalyzer.lua | 2 +- lua/efmls-configs/linters/debride.lua | 2 +- lua/efmls-configs/linters/eslint.lua | 2 +- lua/efmls-configs/linters/eslint_d.lua | 2 +- lua/efmls-configs/linters/fecs.lua | 2 +- lua/efmls-configs/linters/fish.lua | 2 +- lua/efmls-configs/linters/flawfinder.lua | 2 +- lua/efmls-configs/linters/gcc.lua | 2 +- lua/efmls-configs/linters/golangci_lint.lua | 2 +- lua/efmls-configs/linters/mcs.lua | 2 +- lua/efmls-configs/linters/perlcritic.lua | 2 +- lua/efmls-configs/linters/phan.lua | 2 +- lua/efmls-configs/linters/phpstan.lua | 2 +- lua/efmls-configs/linters/psalm.lua | 2 +- lua/efmls-configs/linters/pylint.lua | 2 +- lua/efmls-configs/linters/reek.lua | 2 +- lua/efmls-configs/linters/rubocop.lua | 2 +- lua/efmls-configs/linters/slim_lint.lua | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lua/efmls-configs/linters/actionlint.lua b/lua/efmls-configs/linters/actionlint.lua index 03bb683..c906dfe 100644 --- a/lua/efmls-configs/linters/actionlint.lua +++ b/lua/efmls-configs/linters/actionlint.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'actionlint' -local command = string.format('%s -no-color -oneline -stdin-filename ${INPUT} -', fs.executable(linter)) +local command = string.format('%s -no-color -oneline -stdin-filename "${INPUT}" -', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/ameba.lua b/lua/efmls-configs/linters/ameba.lua index 6f9bad0..3514f9d 100644 --- a/lua/efmls-configs/linters/ameba.lua +++ b/lua/efmls-configs/linters/ameba.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'ameba' -local command = string.format('%s --no-color --format flycheck ${INPUT}', fs.executable(linter)) +local command = string.format('%s --no-color --format flycheck "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/clang_tidy.lua b/lua/efmls-configs/linters/clang_tidy.lua index 60dc759..30f7c3c 100644 --- a/lua/efmls-configs/linters/clang_tidy.lua +++ b/lua/efmls-configs/linters/clang_tidy.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'clang-tidy' -local command = string.format('%s ${INPUT}', fs.executable(linter)) +local command = string.format('%s "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/clazy.lua b/lua/efmls-configs/linters/clazy.lua index 7772d05..1eae1a7 100644 --- a/lua/efmls-configs/linters/clazy.lua +++ b/lua/efmls-configs/linters/clazy.lua @@ -10,7 +10,7 @@ local args = { '--extra-arg=-Xclang', '--extra-arg=-analyzer-output=text', '--extra-arg=-fno-color-diagnostics', - '${INPUT}', + '"${INPUT}"', } local command = string.format('%s %s', fs.executable(linter), table.concat(args, ' ')) diff --git a/lua/efmls-configs/linters/codespell.lua b/lua/efmls-configs/linters/codespell.lua index f0d8c49..679f315 100644 --- a/lua/efmls-configs/linters/codespell.lua +++ b/lua/efmls-configs/linters/codespell.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'codespell' -local command = string.format('%s --disable-colors ${INPUT}', fs.executable(linter)) +local command = string.format('%s --disable-colors "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/cppcheck.lua b/lua/efmls-configs/linters/cppcheck.lua index 5980750..3b478fe 100644 --- a/lua/efmls-configs/linters/cppcheck.lua +++ b/lua/efmls-configs/linters/cppcheck.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'cppcheck' local command = string.format( - '%s --quiet --force --enable=warning,style,performance,portability --error-exitcode=1 ${INPUT}', + '%s --quiet --force --enable=warning,style,performance,portability --error-exitcode=1 "${INPUT}"', fs.executable(linter) ) diff --git a/lua/efmls-configs/linters/cpplint.lua b/lua/efmls-configs/linters/cpplint.lua index c6ea13f..c66e63e 100644 --- a/lua/efmls-configs/linters/cpplint.lua +++ b/lua/efmls-configs/linters/cpplint.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'cpplint' -local command = string.format('%s ${INPUT}', fs.executable(linter)) +local command = string.format('%s "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/cspell.lua b/lua/efmls-configs/linters/cspell.lua index 75ff967..8ed0ec6 100644 --- a/lua/efmls-configs/linters/cspell.lua +++ b/lua/efmls-configs/linters/cspell.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'cspell' -local command = string.format('%s --no-color --no-progress --no-summary ${INPUT}', fs.executable(linter)) +local command = string.format('%s --no-color --no-progress --no-summary "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/dartanalyzer.lua b/lua/efmls-configs/linters/dartanalyzer.lua index da72283..c508c25 100644 --- a/lua/efmls-configs/linters/dartanalyzer.lua +++ b/lua/efmls-configs/linters/dartanalyzer.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'dartanalyzer' -local command = string.format('%s --format machine ${INPUT}', fs.executable(linter)) +local command = string.format('%s --format machine "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/debride.lua b/lua/efmls-configs/linters/debride.lua index bfb1af1..3eeb975 100644 --- a/lua/efmls-configs/linters/debride.lua +++ b/lua/efmls-configs/linters/debride.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'debride' -local command = string.format('%s ${INPUT}', fs.executable(linter)) +local command = string.format('%s "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/eslint.lua b/lua/efmls-configs/linters/eslint.lua index 0fa36c0..4f49a26 100644 --- a/lua/efmls-configs/linters/eslint.lua +++ b/lua/efmls-configs/linters/eslint.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'eslint' local bin = fs.executable(linter, fs.Scope.NODE) -local args = '--no-color --format visualstudio --stdin-filename ${INPUT} --stdin' +local args = '--no-color --format visualstudio --stdin-filename "${INPUT}" --stdin' local command = string.format('%s %s', bin, args) return { diff --git a/lua/efmls-configs/linters/eslint_d.lua b/lua/efmls-configs/linters/eslint_d.lua index 485644b..0d9e2a0 100644 --- a/lua/efmls-configs/linters/eslint_d.lua +++ b/lua/efmls-configs/linters/eslint_d.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'eslint_d' local bin = fs.executable(linter, fs.Scope.NODE) -local args = '--no-color --format visualstudio --stdin-filename ${INPUT} --stdin' +local args = '--no-color --format visualstudio --stdin-filename "${INPUT}" --stdin' local command = string.format('%s %s', bin, args) return { diff --git a/lua/efmls-configs/linters/fecs.lua b/lua/efmls-configs/linters/fecs.lua index 10a3b1b..859a341 100644 --- a/lua/efmls-configs/linters/fecs.lua +++ b/lua/efmls-configs/linters/fecs.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') local linter = 'fecs' local bin = fs.executable(linter, fs.Scope.NODE) -local args = 'check --color=false --stream ${INPUT}' +local args = 'check --color=false --stream "${INPUT}"' local command = string.format('%s %s', bin, args) return { diff --git a/lua/efmls-configs/linters/fish.lua b/lua/efmls-configs/linters/fish.lua index c9a194f..d7d4779 100644 --- a/lua/efmls-configs/linters/fish.lua +++ b/lua/efmls-configs/linters/fish.lua @@ -4,7 +4,7 @@ local fs = require('efmls-configs.fs') local command = fs.executable('fish') -local lintCommand = string.format('%s --no-execute ${INPUT}', command) +local lintCommand = string.format('%s --no-execute "${INPUT}"', command) return { lintCommand = lintCommand, diff --git a/lua/efmls-configs/linters/flawfinder.lua b/lua/efmls-configs/linters/flawfinder.lua index 2bf552c..681314a 100644 --- a/lua/efmls-configs/linters/flawfinder.lua +++ b/lua/efmls-configs/linters/flawfinder.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'flawfinder' -local command = string.format('%s --singleline --dataonly ${INPUT}', fs.executable(linter)) +local command = string.format('%s --singleline --dataonly "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/gcc.lua b/lua/efmls-configs/linters/gcc.lua index 7d4d3f8..a7b63bc 100644 --- a/lua/efmls-configs/linters/gcc.lua +++ b/lua/efmls-configs/linters/gcc.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'gcc' -local args = { '-Wpedantic', '-Wall', '-Wextra', '-fno-diagnostics-color', '-fsyntax-only', '${INPUT}' } +local args = { '-Wpedantic', '-Wall', '-Wextra', '-fno-diagnostics-color', '-fsyntax-only', '"${INPUT}"' } local command = string.format('%s %s', fs.executable(linter), table.concat(args, ' ')) return { diff --git a/lua/efmls-configs/linters/golangci_lint.lua b/lua/efmls-configs/linters/golangci_lint.lua index 7eb08d1..1086fa8 100644 --- a/lua/efmls-configs/linters/golangci_lint.lua +++ b/lua/efmls-configs/linters/golangci_lint.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'golangci-lint' -local command = string.format('%s run --color never --out-format tab ${INPUT}', fs.executable(linter)) +local command = string.format('%s run --color never --out-format tab "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/mcs.lua b/lua/efmls-configs/linters/mcs.lua index 1772103..7ce8660 100644 --- a/lua/efmls-configs/linters/mcs.lua +++ b/lua/efmls-configs/linters/mcs.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'mcs' -local command = string.format('%s -unsafe --parse ${INPUT}', fs.executable(linter)) +local command = string.format('%s -unsafe --parse "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/perlcritic.lua b/lua/efmls-configs/linters/perlcritic.lua index 3c12807..f8e0ec6 100644 --- a/lua/efmls-configs/linters/perlcritic.lua +++ b/lua/efmls-configs/linters/perlcritic.lua @@ -1,7 +1,7 @@ local fs = require('efmls-configs.fs') local linter = 'perlcritic' -local command = string.format('%s --nocolor --verbose "%s" ${INPUT}', fs.executable(linter), [[%l:%c:%s %m [%p]\n]]) +local command = string.format('%s --nocolor --verbose "%s" "${INPUT}"', fs.executable(linter), [[%l:%c:%s %m [%p]\n]]) return { prefix = linter, diff --git a/lua/efmls-configs/linters/phan.lua b/lua/efmls-configs/linters/phan.lua index 83da503..e0f4922 100644 --- a/lua/efmls-configs/linters/phan.lua +++ b/lua/efmls-configs/linters/phan.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'phan' -local command = string.format('%s --output-mode pylint ${INPUT}', fs.executable(linter, fs.Scope.COMPOSER)) +local command = string.format('%s --output-mode pylint "${INPUT}"', fs.executable(linter, fs.Scope.COMPOSER)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/phpstan.lua b/lua/efmls-configs/linters/phpstan.lua index e5a637d..0f5aad7 100644 --- a/lua/efmls-configs/linters/phpstan.lua +++ b/lua/efmls-configs/linters/phpstan.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'phpstan' -local args = 'analyse --no-progress --no-ansi --error-format=raw ${INPUT}' +local args = 'analyse --no-progress --no-ansi --error-format=raw "${INPUT}"' local command = string.format('%s %s', fs.executable(linter, fs.Scope.COMPOSER), args) return { diff --git a/lua/efmls-configs/linters/psalm.lua b/lua/efmls-configs/linters/psalm.lua index 6b9a60e..71b408e 100644 --- a/lua/efmls-configs/linters/psalm.lua +++ b/lua/efmls-configs/linters/psalm.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'psalm' -local args = '--no-progress --no-cache --output-format=emacs ${INPUT}' +local args = '--no-progress --no-cache --output-format=emacs "${INPUT}"' local command = string.format('%s %s', fs.executable(linter, fs.Scope.COMPOSER), args) return { diff --git a/lua/efmls-configs/linters/pylint.lua b/lua/efmls-configs/linters/pylint.lua index d0672a4..ebe678c 100644 --- a/lua/efmls-configs/linters/pylint.lua +++ b/lua/efmls-configs/linters/pylint.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'pylint' -local command = string.format('%s --score=no ${INPUT}', fs.executable(linter)) +local command = string.format('%s --score=no "${INPUT}"', fs.executable(linter)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/reek.lua b/lua/efmls-configs/linters/reek.lua index 5330387..6a9b768 100644 --- a/lua/efmls-configs/linters/reek.lua +++ b/lua/efmls-configs/linters/reek.lua @@ -6,7 +6,7 @@ local fs = require('efmls-configs.fs') -- TODO: Not properly implemented yet local linter = 'reek' -local args = 'exec reek --format txt --force-exclusion --stdin-filename ${INPUT}' +local args = 'exec reek --format txt --force-exclusion --stdin-filename "${INPUT}"' local command = string.format('%s %s', fs.executable('bundle', fs.Scope.BUNDLE), args) return { diff --git a/lua/efmls-configs/linters/rubocop.lua b/lua/efmls-configs/linters/rubocop.lua index 026f2e7..f0c26ac 100644 --- a/lua/efmls-configs/linters/rubocop.lua +++ b/lua/efmls-configs/linters/rubocop.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'rubocop' -local command = string.format('%s --lint --format emacs --stdin ${INPUT}', fs.executable(linter, fs.Scope.BUNDLE)) +local command = string.format('%s --lint --format emacs --stdin "${INPUT}"', fs.executable(linter, fs.Scope.BUNDLE)) return { prefix = linter, diff --git a/lua/efmls-configs/linters/slim_lint.lua b/lua/efmls-configs/linters/slim_lint.lua index b2a098e..b4e1762 100644 --- a/lua/efmls-configs/linters/slim_lint.lua +++ b/lua/efmls-configs/linters/slim_lint.lua @@ -5,7 +5,7 @@ local fs = require('efmls-configs.fs') local linter = 'slim-lint' -local command = string.format('%s --stdin-file-path ${INPUT}', fs.executable(linter, fs.Scope.BUNDLE)) +local command = string.format('%s --stdin-file-path "${INPUT}"', fs.executable(linter, fs.Scope.BUNDLE)) return { prefix = linter,