From 49916c605f822ebad0d1a664e9de4c6ef289f424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20L=C3=A9vigne?= Date: Wed, 8 Nov 2023 14:51:29 +0100 Subject: [PATCH] Update puppet-lint (#451) --- lua/lint/linters/puppet-lint.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lua/lint/linters/puppet-lint.lua b/lua/lint/linters/puppet-lint.lua index 558217af..ee2a3023 100644 --- a/lua/lint/linters/puppet-lint.lua +++ b/lua/lint/linters/puppet-lint.lua @@ -1,14 +1,20 @@ -local errorformat = '%f:%l:%c:%tarning:%m, %f:%l:%c:%trror:%m' +local pattern = '(.+):(%d+):(%d+):(%l+):(.+):(.+)' +local groups = { 'file', 'lnum', 'col', 'severity', 'code', 'message' } + +local severities = { + ['error'] = vim.diagnostic.severity.ERROR, + ['warning'] = vim.diagnostic.severity.WARN, +} return { cmd = 'puppet-lint', stdin = false, args = { '--no-autoloader_layout-check', - '--log-format', '%{path}:%{line}:%{column}:%{kind}:[%{check}] %{message}' + '--log-format', '%{path}:%{line}:%{column}:%{kind}:%{check}:%{message}' }, ignore_exitcode = true, - parser = require('lint.parser').from_errorformat(errorformat, { - source = 'puppet-lint', - }) + parser = require('lint.parser').from_pattern(pattern, groups, severities, { + ['source'] = 'puppet-lint', + }), }