Issue 134502
Summary [clang-tidy] Fix [File|Config]OptionsProvider::getOptions
Labels clang-tidy
Assignees
Reporter carlosgalvezp
    https://github.com/llvm/llvm-project/pull/121323 changed the way the absolute path is computed. 
This led to `HeaderFilterRegex` not picked up from the `.clang-tidy` file sitting at the current working directory.  This has partially been fixed by https://github.com/llvm/llvm-project/pull/133582, but nevertheless this should be fixed here as well.


Before the PR:

```
Getting options for file ''
AbsolutePath: /path/to/root/
```

After the PR:

```
Getting options for file ''
AbsolutePath: /path/to/root
```

I.e. there is a missing trailing slash. This makes the `addRawFileOptions` no longer work, because it does this:

```
  StringRef RootPath = llvm::sys::path::parent_path(AbsolutePath);
```

Since the `AbsolutePath` no longer has a slash, instead of picking `/path/to/root` as `RootPath`, it picks `/path/to`, and there is no `.clang-tidy` file there.


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to