From 19b0c6b10c6e10d9914dec151536093df3443347 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Sat, 27 Jul 2019 14:18:30 +0100 Subject: [PATCH] Allow setting pylint arguments from .dir-locals.el Work around the issue https://github.com/palantir/python-language-server/issues/616, which would be fixed by https://github.com/emacs-lsp/lsp-mode/pull/928, but is not yet merged. --- emacs/config.d/20-packages.el | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/emacs/config.d/20-packages.el b/emacs/config.d/20-packages.el index 3c46e0f..d6c7f9f 100644 --- a/emacs/config.d/20-packages.el +++ b/emacs/config.d/20-packages.el @@ -161,7 +161,25 @@ (use-package lsp-mode :hook (prog-mode . lsp) - :commands lsp) + :commands lsp + :config + ;; Remove once https://github.com/emacs-lsp/lsp-mode/pull/928 is merged and + ;; released. + ;; + ;; Allows us to specify command-line arguments to pylint, which lets us + ;; provide a .dir-locals.el that sets `--rcfile=`, + ;; avoiding a tonne of spurious errors while still getting pylint feedback. + ;; + ;; e.g. + ;; + ;; ((nil . ((lsp-pyls-plugins-pylint-args . '("--rcfile=/Users/jml/src/myproject/pylintrc"))))) + (defcustom lsp-pyls-plugins-pylint-args nil + "Command-line arguments to pylint." + :risky t + :type '(repeat string) + :group 'lsp-pyls) + (lsp-register-custom-settings + '(("pyls.plugins.pylint.args" lsp-pyls-plugins-pylint-args)))) (use-package lsp-ui :after diminish