From 6e89a133d0ef3b3bb76cb12e97a61b5cbcb8aedc Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 23 May 2024 14:06:34 +0100 Subject: [PATCH] Remove flymake-ruff and add flymake-yamllint config Fix using ruff via python-flymake-command which gives better messages than flymake-ruff anyway (distinguishes between warnings and errors) Add config to start flymake-mode and setup flymake-yamllint for YAML files --- init.el | 35 +++++++++++++++-------------------- install.el | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/init.el b/init.el index efefa03..ebcf15e 100644 --- a/init.el +++ b/init.el @@ -456,10 +456,10 @@ (set-face-attribute 'doom-modeline nil :weight 'normal) (doom-modeline-mode +1)) -(line-number-mode +1) -(column-number-mode +1) +(line-number-mode -1) +(column-number-mode -1) (size-indication-mode +1) -(display-time-mode +1) +(display-time-mode -1) (require 'battery) (when (and battery-status-function @@ -909,27 +909,22 @@ :hook (prog-mode . (lambda () (flymake-mode +1)))) (use-package flymake-popon - :after flymake :diminish - :init - (global-flymake-popon-mode +1)) - -(use-package flymake-collection - :disabled - :after flymake - :custom - ;; Extra mypy config - (flymake-collection-mypy-args '("--ignore-missing-imports" - "--follow-imports=skip" - "--check-untyped-defs" - "--warn-unreachable" - "--show-error-codes" - "--no-color-output"))) + :requires flymake + :hook (flymake-mode . (lambda () (flymake-popon-mode +1)))) (use-package flymake-shellcheck - :after flymake + :if (executable-find "shellcheck") + :requires flymake :hook (sh-mode . flymake-shellcheck-load)) +(use-package flymake-yamllint + :if (executable-find "yamllint") + :requires flymake + :hook (yaml-ts-mode . (lambda () + (progn (flymake-mode +1) + (flymake-yamllint-setup))))) + (use-package project :custom (project-switch-use-entire-map t) @@ -1001,7 +996,7 @@ Calls `project-remember-project-under' for ~/Projects/" :custom (python-shell-interpreter "python3") (python-flymake-command - (cond ((executable-find "ruff") '("ruff" "check" "-e" "--output-format" "pylint" "-")) + (cond ((executable-find "ruff") '("ruff" "check" "--output-format=pylint" "--stdin-filename=stdin" "-")) ((executable-find "flake8") '("flake8" "--max-line-length" "88" "-")) (t '("pyflakes")))) (python-check-command diff --git a/install.el b/install.el index 1a15984..121c5ff 100644 --- a/install.el +++ b/install.el @@ -17,7 +17,7 @@ ;; password-store pass password-store password-store-otp ;; IDE - treesit-auto flymake-popon flymake-ruff flymake-shellcheck flymake-yamllint apheleia envrc rainbow-delimiters aggressive-indent python-docstring nix-mode lua-mode + treesit-auto flymake-popon flymake-shellcheck flymake-yamllint apheleia envrc rainbow-delimiters aggressive-indent python-docstring nix-mode lua-mode ;; Media emms ;; org-mode