refactor: use negated flags

Ref: 7a806521a92c
This commit is contained in:
Henrik Lissner
2024-10-19 14:57:44 -04:00
parent 15904349cf
commit 448bc5cae2
73 changed files with 87 additions and 132 deletions

View File

@@ -160,7 +160,7 @@ This is ignored by ccls.")
cuda-mode-local-vars-hook)
:append #'lsp!)
(if (not (modulep! :tools lsp +eglot))
(if (modulep! :tools lsp -eglot)
(after! lsp-clangd
;; Prevent clangd from consuming all your cores indexing larger projects
;; and grinding your system to a halt.
@@ -185,7 +185,7 @@ This is ignored by ccls.")
(use-package! ccls
:when (modulep! +lsp)
:unless (modulep! :tools lsp +eglot)
:when (modulep! :tools lsp -eglot)
:defer t
:init
(defvar ccls-sem-highlight-method 'font-lock)

View File

@@ -19,5 +19,5 @@
:pin "404cd0694ab34971f9c01eb22126cd2e7d3f9dc4")))
(when (and (modulep! +lsp)
(not (modulep! :tools lsp +eglot)))
(modulep! :tools lsp -eglot))
(package! ccls :pin "41399b0eba03f9b80769ced71501ba702db4cd62"))

View File

@@ -282,7 +282,7 @@
(use-package! clj-refactor
:when (or (not (modulep! +lsp))
:when (or (modulep! -lsp)
+clojure-load-clj-refactor-with-lsp)
:hook (clojure-mode . clj-refactor-mode)
:config
@@ -295,9 +295,8 @@
;; clojure-lsp already uses clj-kondo under the hood
(use-package! flycheck-clj-kondo
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake))
(not (modulep! +lsp)))
:when (modulep! -lsp)
:when (modulep! :checkers syntax -flymake)
:after flycheck)

View File

@@ -2,7 +2,7 @@
;;; lang/clojure/doctor.el
(when (and (modulep! :checkers syntax)
(not (modulep! +lsp)))
(modulep! -lsp))
(unless (executable-find "clj-kondo")
(warn! "Couldn't find clj-kondo. flycheck-clj-kondo will not work.")))

View File

@@ -17,8 +17,7 @@
(package! clojure-mode :pin "59888c84b61081e9b0085e388f55132925a66e7a")
(package! clj-refactor :pin "dc1bbc8cdaa723bdbb6669ea7d280625c370755d")
(package! cider :pin "8fdb53e8be764704f5023fa024d023bffedf5a8b")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-clj-kondo :pin "e38c67ba9db1ea1cbe1b61ab39b506c05efdcdbf"))
(package! jet :pin "c9a92675efd802f37df5e3eab7858dbbeced6ea4")
(package! neil

View File

@@ -18,14 +18,12 @@
(use-package! flycheck-crystal
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after crystal-mode)
(use-package! flycheck-ameba
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after crystal-mode
:config (flycheck-ameba-setup))

View File

@@ -3,7 +3,6 @@
(package! crystal-mode :pin "ea89b108fa4222df94ffb99e6e7eaec5d7aa4fea")
(package! inf-crystal :pin "02007b2a2a3bea44902d7c83c4acba1e39d278e3")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-crystal :pin "ea89b108fa4222df94ffb99e6e7eaec5d7aa4fea")
(package! flycheck-ameba :pin "0c4925ae0e998818326adcb47ed27ddf9761c7dc"))

View File

@@ -1,7 +1,7 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/csharp/doctor.el
(when (and (require 'omnisharp nil t) (not (modulep! +lsp)))
(when (and (require 'omnisharp nil t) (modulep! -lsp))
(let ((omnisharp-bin (or omnisharp-server-executable-path (omnisharp--server-installation-path t))))
(unless (file-exists-p omnisharp-bin)
(warn! "Omnisharp server isn't installed, completion won't work"))))

View File

@@ -4,7 +4,7 @@
(package! dart-mode :pin "44beb628e5b4774062f7486008e06ae663e1ced0")
(when (and (modulep! +lsp)
(not (modulep! :tools lsp +eglot)))
(modulep! :tools lsp -eglot))
(package! lsp-dart :pin "9ffbafb7dcea3ef3d9e29bafb51d5167f0585d2c"))
(when (modulep! +flutter)

View File

@@ -52,8 +52,7 @@
(use-package! flycheck-credo
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after elixir-mode
:config (flycheck-credo-setup))

View File

@@ -4,6 +4,5 @@
;; +elixir.el
(package! elixir-mode :pin "00d6580a040a750e019218f9392cf9a4c2dac23a")
(package! exunit :pin "ee06b14b61beaf59d847802b83b027ac991f3496")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-credo :pin "e285bd042a535d0f13e0b4c5226df404cdda4033"))

View File

@@ -27,7 +27,6 @@
:desc "Compile JS (optimized)" "J" #'+elm/compile-js-optimized)))
(use-package! flycheck-elm
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after elm-mode
:config (add-to-list 'flycheck-checkers 'elm))

View File

@@ -2,6 +2,5 @@
;;; lang/elm/packages.el
(package! elm-mode :pin "699841865e1bd5b7f2077baa7121510b6bcad3c7")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-elm :pin "1b60050efd4729bfba548f3e5adbcb58436667cb"))

View File

@@ -195,8 +195,7 @@ See `+emacs-lisp-non-package-mode' for details.")
(use-package! flycheck-cask
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:defer t
:init
(add-hook! 'emacs-lisp-mode-hook
@@ -204,8 +203,7 @@ See `+emacs-lisp-non-package-mode' for details.")
(use-package! flycheck-package
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after flycheck
:config (flycheck-package-setup))

View File

@@ -12,8 +12,7 @@
(package! overseer :pin "7fdcf1a6fba6b1569a09c1666b4e51bcde266ed9")
(package! elisp-def :pin "1ad4baccbf3d0d13e7607d332ae6bc60a5dd7360")
(package! elisp-demos :pin "1a108d1c5011f9ced58be2ca98bea1fbd4130a2f")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-package :pin "75efa098cf17dc14c363e2ca9b68afdac7766b5b")
(package! flycheck-cask :pin "0eeec5197e9d31bfcfc39380b262d65259a87d91"))

View File

@@ -105,7 +105,6 @@
:hook (stan-mode . company-stan-setup))
(use-package! flycheck-stan
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:hook (stan-mode . flycheck-stan-stanc2-setup)
:hook (stan-mode . flycheck-stan-stanc3-setup)))

View File

@@ -11,6 +11,5 @@
(package! eldoc-stan :pin "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581")
(when (modulep! :completion company)
(package! company-stan :pin "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581"))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-stan :pin "150bbbe5fd3ad2b5a3dbfba9d291e66eeea1a581")))

View File

@@ -9,7 +9,7 @@
(not (executable-find "ifort")))
(warn! "Couldn't find Intel ifort - compilation will not work."))
(when (and (not (modulep! +intel))
(when (and (modulep! -intel)
(not (executable-find "gfortran")))
(warn! "Couldn't find gfortran - compilation will not work."))

View File

@@ -58,6 +58,5 @@
(use-package! flycheck-golangci-lint
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:hook (go-mode . flycheck-golangci-lint-setup))

View File

@@ -19,7 +19,7 @@
(warn! "Couldn't find gomodifytags. Manipulating struct tags will not work"))
(when (and (modulep! :completion company)
(not (modulep! +lsp)))
(modulep! -lsp))
(require 'company-go)
(unless (executable-find company-go-gocode-command)
(warn! "Couldn't find gocode. Code completion won't work")))

View File

@@ -10,6 +10,5 @@
(when (modulep! :completion company)
(package! company-go :pin "31948b463f2fc18f8801e5a8fe511fef300eb3dd"))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-golangci-lint :pin "91c59b128aa6f719069cfb3e5df77588691a3e14"))

View File

@@ -16,8 +16,7 @@
(after! dtrt-indent
(add-to-list 'dtrt-indent-hook-mapping-list '(graphviz-mode graphviz-dot-indent-width)))
(when (and (modulep! :checker syntax)
(not (modulep! :checker syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(after! flycheck
(eval '(flycheck-define-checker graphviz-dot
"A checker using graphviz dot."

View File

@@ -17,7 +17,7 @@
Install it or enable +lsp."))
(when (and (modulep! :editor format)
(not (modulep! +lsp))
(modulep! -lsp)
(not (executable-find "brittany")))
(warn! "Couldn't find brittany. Code formatting will not work.
Install it or enable +lsp."))

View File

@@ -4,5 +4,5 @@
(package! haskell-mode :pin "727f72a2a4b8e4fd0a7b62129668baea55a2c3e0")
(when (and (modulep! +lsp)
(not (modulep! :tools lsp +eglot)))
(modulep! :tools lsp -eglot))
(package! lsp-haskell :pin "ba49fa9822556aff58aa47929cd426e9427baaea"))

View File

@@ -23,6 +23,5 @@
(use-package! flycheck-idris
:when (modulep! :checkers syntax)
:when (not (modulep! :checkers syntax +flymake))
:when (modulep! :checkers syntax -flymake)
:after idris-mode)

View File

@@ -1,5 +1,5 @@
;;; lang/java/+lsp.el -*- lexical-binding: t; -*-
;;;###if (and (modulep! +lsp) (not (modulep! :tools lsp +eglot)))
;;;###if (and (modulep! +lsp) (modulep! :tools lsp -eglot))
(use-package! lsp-java
:defer t

View File

@@ -106,8 +106,7 @@
#'typescript-tsx-mode
#'typescript-mode)))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(after! flycheck
(flycheck-add-mode 'javascript-eslint 'web-mode)
(flycheck-add-mode 'javascript-eslint 'typescript-mode)

View File

@@ -4,6 +4,6 @@
(not (executable-find "jq")))
(warn! "Couldn't find jq. counsel-jq won't work." ))
(assert! (or (not (modulep! +tree-sitter))
(assert! (or (modulep! -tree-sitter)
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")

View File

@@ -15,6 +15,5 @@
(use-package! flycheck-kotlin
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:hook (kotlin-mode . flycheck-kotlin-setup))

View File

@@ -3,6 +3,5 @@
(package! kotlin-mode :pin "fddd747e5b4736e8b27a147960f369b86179ddff")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checker syntax -flymake)
(package! flycheck-kotlin :pin "a2a6abb9a7f85c6fb15ce327459ec3c8ff780188"))

View File

@@ -38,8 +38,7 @@
(use-package! flycheck-ledger
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after ledger-mode)

View File

@@ -6,6 +6,5 @@
(when (modulep! :editor evil)
(package! evil-ledger :pin "7a9f9f5d39c42fffdba8004f8982642351f2b233"))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-ledger :pin "628e25ba66604946085571652a94a54f4d1ad96f"))

View File

@@ -56,8 +56,7 @@ lua-language-server.")
(add-hook! 'moonscript-mode-hook
#'+lua-moonscript-fix-single-quotes-h
#'+lua-moonscript-fontify-interpolation-h)
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(require 'flycheck-moonscript nil t)))

View File

@@ -5,8 +5,7 @@
(when (modulep! +moonscript)
(package! moonscript :pin "56f90471e2ced2b0a177aed4d8c2f854797e9cc7")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-moonscript
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript")
:pin "fcb99e5efcf31db05f236f02eaa575986a57172d")))

View File

@@ -36,6 +36,5 @@ windows."
(use-package! flycheck-nim
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after nim-mode)

View File

@@ -5,6 +5,5 @@
(package! nim-mode :pin "625cc023bd75a741b7d4e629e5bec3a52f45b4be")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-nim :pin "ddfade51001571c2399f78bcc509e0aa8eb752a4"))

View File

@@ -8,6 +8,6 @@
(unless (executable-find nix-nixfmt-bin)
(warn! (concat "Couldn't find " nix-nixfmt-bin ". nix-format-buffer won't work."))))
(assert! (or (not (modulep! +tree-sitter))
(assert! (or (modulep! -tree-sitter)
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")

View File

@@ -70,9 +70,7 @@
"t" #'merlin-type-enclosing)
(use-package! flycheck-ocaml
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:hook (merlin-mode . +ocaml-init-flycheck-h)
:config
(defun +ocaml-init-flycheck-h ()

View File

@@ -12,8 +12,7 @@
(package! merlin :pin "e016abfac6da88ff7a6b49a42ca37854a4378ace")
(package! merlin-eldoc :pin "bf8edc63d85b35e4def352fa7ce4ea39f43e1fd8")
(package! merlin-company :pin "e016abfac6da88ff7a6b49a42ca37854a4378ace")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-ocaml :pin "77f8ddbd9bfc3a11957ac7ec7e45d5fa9179b192")))
(when (modulep! :tools eval)

View File

@@ -49,7 +49,7 @@
:return "return"
:yield "use")
(if (not (modulep! +lsp))
(if (modulep! -lsp)
;; `+php-company-backend' uses `php-extras-company' or
;; `company-dabbrev-code', in that order.
(when +php--company-backends

View File

@@ -35,7 +35,6 @@
:hook (purescript-mode . psc-ide-mode)
:config
(remove-hook 'company-backends 'company-psc-ide-backend)
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(psc-ide-flycheck-setup))
(set-company-backend! 'purescript-mode 'company-psc-ide-backend))

View File

@@ -323,8 +323,7 @@
(use-package! flycheck-cython
:when (modulep! +cython)
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after cython-mode)
@@ -352,7 +351,7 @@
(use-package! lsp-pyright
:when (modulep! +lsp)
:when (modulep! +pyright)
:when (not (modulep! :tools lsp +eglot))
:when (modulep! :tools lsp -eglot)
:defer t
:init
(when-let ((exe (executable-find "basedpyright")))

View File

@@ -9,6 +9,5 @@
(use-package! flycheck-raku
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after raku-mode)

View File

@@ -3,8 +3,7 @@
(package! raku-mode :pin "14f9b9bba08c0bbb7f3895380d0b1a9feb7a168d")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-raku
:recipe (:host github :repo "widefox/flycheck-raku")
:pin "b1acccd6e9d9753022571ee96d18b8e9f3227c65"))

View File

@@ -46,7 +46,7 @@
(setq rustic-babel-format-src-block nil
rustic-format-trigger nil)
(if (not (modulep! +lsp))
(if (modulep! -lsp)
(after! rustic-flycheck
(add-to-list 'flycheck-checkers 'rustic-clippy))
(setq rustic-lsp-client

View File

@@ -5,5 +5,5 @@
(package! scala-mode :pin "bd0638c32ab0f2eadacf2809329abf5388211760")
(when (and (modulep! +lsp)
(not (modulep! :tools lsp +eglot)))
(modulep! :tools lsp -eglot))
(package! lsp-metals :pin "0dc938be1190d147e7013e3dce08ac8bff5d1662"))

View File

@@ -78,8 +78,7 @@
(use-package! flycheck-guile
:when (modulep! +guile)
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:after geiser)
;; Add Guix channels to Guile load path

View File

@@ -20,8 +20,7 @@
(package! geiser-gauche :pin "8ff743f6416f00751e24aef8b9791501a40f5421"))
(when (modulep! +guile)
(package! geiser-guile :pin "5a856c2982030ff77e2d151ead4fcd991512f362")
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-guile
:recipe (:host github :repo "flatwhatson/flycheck-guile")
:pin "dd7bbdc48fd21cf8d270c913c56cd580f8ec3d03")))

View File

@@ -8,6 +8,6 @@
(unless (executable-find "shfmt")
(warn! "Couldn't find shfmt. Code formatting will not work.")))
(assert! (or (not (modulep! +tree-sitter))
(assert! (or (modulep! -tree-sitter)
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")

View File

@@ -10,8 +10,7 @@
(set-formatter! 'prettier-solidity '(npx "prettier" "--stdin-filepath" filepath "--parser=solidity") :modes '(solidity-mode))
(use-package! solidity-flycheck ; included with solidity-mode
:when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
:when (modulep! :checkers syntax -flymake)
:config
(setq flycheck-solidity-solc-addstd-contracts t)
(when (funcall flycheck-executable-find solidity-solc-path)

View File

@@ -4,6 +4,5 @@
(package! solidity-mode :pin "8ba549e429e86778a0e079648f3bc3463fcb15f6")
(when (modulep! :completion company)
(package! company-solidity))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! solidity-flycheck))

View File

@@ -27,7 +27,7 @@
(use-package! lsp-sourcekit
:when (modulep! +lsp)
:when (not (modulep! :tools lsp +eglot))
:when (modulep! :tools lsp -eglot)
:defer t
:init (add-hook 'swift-mode-local-vars-hook #'lsp! 'append)
:config

View File

@@ -1,6 +1,6 @@
;;; lang/swift/doctor.el -*- lexical-binding: t; -*-
(assert! (or (not (modulep! +tree-sitter))
(assert! (or (modulep! -tree-sitter)
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")

View File

@@ -8,6 +8,5 @@
(package! lsp-sourcekit :pin "63ff1ab638b655089077d17fdd728a48f8906e02"))
(when (modulep! :completion company)
(package! company-sourcekit :pin "a1860ad4dd3a542acd2fa0dfac2a388cbdf4af0c"))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(package! flycheck-swift :pin "4c5ad401252400a78da395fd56a71e67ff8c2761")))

View File

@@ -20,8 +20,7 @@
(when (modulep! +tree-sitter)
(add-hook 'zig-mode-local-vars-hook #'tree-sitter! 'append))
(when (and (modulep! :checkers syntax)
(not (modulep! :checkers syntax +flymake)))
(when (modulep! :checkers syntax -flymake)
(eval '(flycheck-define-checker zig
"A zig syntax checker using zig's `ast-check` command."
:command ("zig" "ast-check" (eval (buffer-file-name)))

View File

@@ -1,11 +1,11 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/zig/doctor.el
(assert! (or (not (modulep! +lsp))
(assert! (or (modulep! -lsp)
(modulep! :tools lsp))
"This module requires (:tools lsp)")
(assert! (or (not (modulep! +tree-sitter))
(assert! (or (modulep! -tree-sitter)
(modulep! :tools tree-sitter))
"This module requires (:tools tree-sitter)")