Clang-tidy configuration file does not work with emacs-lsp

What happened?

Whatever I changed my $HOME/.clang-tidy, the editor always shows the same output.

What did you expect to happen?

the editor’s clang-tidy output should follow the $HOME/.clang-tidy rules.

Steps to reproduce

For example, I want to hide the diagnostic output like "Parameter name ‘xx’ is too short, expected at least 3 characters [readability-identifier-length]" in clang-tidy

And this is my current clang-tidy --list-checks | grep readability-identifier-length output:

> clang-tidy --list-checks  | grep readability-identifier-length                
    
readability-identifier-length

and in emacs, flycheck-list-errors shows:

Now I’m adding -readability-identifier-length to my $HOME/.clang-tidy file’s Checks arguments list to disable checking it:

Checks: 
'-*,
clang-analyzer-*,
readability-*,
modernize-*,

-clang-analyzer-osx*,
-readability-identifier-length
'

And below is my current output:

> clang-tidy --list-checks  | grep readability-identifier-length                 
>        

The check is hidden, so the config file should work after changing, but my flycheck-list-errors output does not change, no matter if I execute lsp-restart-workspace or restart emacs.

And I’ve confirmed that there is no other clang-tidy in the parent directory except $HOME/.clang-tidy.

System information

  • Emacs version: 28.1
  • Operating system: Gentoo
  • Link to private config: here

Which plugin are you using to run lsp-servers lsp-mode or eglot? Also, what server are you using clangd or ccls?