llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.16k stars 12.03k forks source link

[BUG] Clang-tidy 18: `ExtraArgs:` is ignored when specified in config #88390

Open astro-stan opened 7 months ago

astro-stan commented 7 months ago

The ExtraArgs: sequence is ignored when specified in the clang-tidy config.

For example:

# .clang-tidy config
...
ExtraArgs:
  - '-Wno-unknown-warning-option' # same result without single quotes

Results in:

error: no such file or directory: '-Wno-unknown-warning-option' [clang-diagnostic-error]

However, when specified on the command line (--extra-arg -Wno-unknown-warning-option) it works fine.

According to the docs, ExtraArgs in the config file is the same as --extra-arg on the command line.

PiotrZSL commented 7 months ago

This may help: https://github.com/llvm/llvm-project/pull/66553

astro-stan commented 7 months ago

Oh so it should work with ExtraArgsBefore? Thanks.

Also good to know the other way is close to getting fixed!