0

I'm trying to get clang-tidy working to analyze my code. Currently, I have this command:

clang-tidy file.C -- -I/all/my/include/files -L/all/my/libs <any_other_args_i_need>

I'm assuming this works fine because I get this result:

End of search list.
12 warnings generated.
Suppressed 12 warnings (12 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

Now, when I add any other argument (i.e. -checks=-*,clang-analyzer-*,-clang-analyzer-cplusplus*), I get the error clang-tidy: No match. This error pops up when I add any other -argument in addition to my command above.

Does anyone know what this issue is?

helloworld95
  • 366
  • 7
  • 17

1 Answers1

1

I had this issue. For me it was a problem with the default settings for zsh, which I have recently installed.

This is from the zsh documentation:

NOMATCH (+3) If a pattern for filename generation has no matches, print an error, instead of leaving it unchanged in the argument list. This also applies to file expansion of an initial ~' or ='.

I think it's to stop people from typing things like rm * by accident, which I can see has it's merits although personally I prefer to live dangerously so I disabled it by adding unsetopt nomatch to the end of ~/.zshrc then ran source ~/.zshrc.

If you prefer to stick with the default, you need to call clang-tidy as noglob clang-tidy.

If this is the case I would add alias clang-tidy='noglob clang-tidy' to your .zshrc file.

JPJC
  • 11
  • 1