From f38b0872f0a1f32404e3b0b07f56a208306d68b0 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 4 Feb 2026 11:03:57 -0500 Subject: [PATCH] (yaml-ts-mode-yamllint-options): Use a list of strings It is both simpler to code and marginally more general (allows spaces in arguments). * lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode-yamllint-options): Use a list. (yaml-ts-mode-flymake): Adjust accordingly. --- lisp/textmodes/yaml-ts-mode.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lisp/textmodes/yaml-ts-mode.el b/lisp/textmodes/yaml-ts-mode.el index 948186b5a9a..c1521c82c22 100644 --- a/lisp/textmodes/yaml-ts-mode.el +++ b/lisp/textmodes/yaml-ts-mode.el @@ -48,12 +48,11 @@ (defcustom yaml-ts-mode-yamllint-options nil "Additional options to pass to yamllint command used for Flymake support. -If non-nil, this should be a single string with command-line options -for the yamllint command, with individual options separated by whitespace." +This should be a list of strings, each one passed as a separate argument +to the yamllint command." :group 'yaml-ts-mode :version "31.1" - :type '(choice (const :tag "None" nil) - (string :tag "Options as a single string"))) + :type '(repeat string)) (defvar yaml-ts-mode--syntax-table (let ((table (make-syntax-table))) @@ -199,10 +198,7 @@ Calls REPORT-FN directly." (when (process-live-p yaml-ts-mode--flymake-process) (kill-process yaml-ts-mode--flymake-process)) (let ((yamllint (executable-find "yamllint")) - (params (if yaml-ts-mode-yamllint-options - (append (split-string yaml-ts-mode-yamllint-options) '("-f" "parsable" "-")) - '("-f" "parsable" "-"))) - + (params (append yaml-ts-mode-yamllint-options '("-f" "parsable" "-"))) (source (current-buffer)) (diagnostics-pattern (eval-when-compile (rx bol (+? nonl) ":" ; every diagnostic line start with the filename