ch1bo / flycheck-clang-tidy

Flycheck syntax checker using clang-tidy
MIT License
35 stars 12 forks source link

Rewrite temporary files handling #7

Closed tastytea closed 5 years ago

tastytea commented 5 years ago

The source argument instructs Flycheck to create a temporary file containing the content of the current buffer. This makes commit 4d7d33e063ea38003f9a9baa98b3a78779715b79 unnecessary, unless I miss something.

The directory of the current source file is passed as include dir to the compiler because #includes of files in the same directory wouldn't work otherwise.

Because clang-tidy can't find the appropriate config file if the source file is in a temporary directory, the config is located, read and passed to the command.

The :predicate makes sure that the command is only run if the buffer has a file name associated with it (buffer-file-name is used in flycheck-clang-tidy-current-source-dir ()).

Fixes #3
Fixes #6.