Only enable/disable clang-tidy in c++ or c mode.

This commit is contained in:
tastytea 2019-09-29 02:36:24 +02:00
parent 9200c04f76
commit 4e93db2a95
2 changed files with 9 additions and 6 deletions

13
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;; Time-stamp: <2019-09-26T06:22:58+00:00>
;; Time-stamp: <2019-09-29T00:40:15+00:00>
;;; Commentary:
;; I am using this file with Emacs 26, but most of it will probably work with
@ -234,11 +234,14 @@ With argument, do this that many times."
:config
(defun my/clang-tidy-off ()
"Disable c++-clang-tidy."
(add-to-list 'flycheck-disabled-checkers 'c/c++-clang-tidy))
(when (or (eq major-mode 'c++-mode) (eq major-mode 'c-mode))
(add-to-list 'flycheck-disabled-checkers 'c/c++-clang-tidy))
)
(defun my/clang-tidy-on ()
"Enable c++-clang-tidy on."
(setq-local flycheck-disabled-checkers
(remove 'c/c++-clang-tidy flycheck-disabled-checkers))
"Enable c++-clang-tidy."
(when (or (eq major-mode 'c++-mode) (eq major-mode 'c-mode))
(setq-local flycheck-disabled-checkers
(remove 'c/c++-clang-tidy flycheck-disabled-checkers)))
)
:hook
(flycheck-mode . flycheck-clang-tidy-setup)

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 16192
127.0.0.1:51313 16170
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh