[PATCH] D33932: [clang-format] Add support for case-insensitive header matching and use it to improve support for LLVM-style include sorting.
Nikolaus Wittenstein via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 31 08:59:20 PDT 2019
adzenith added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
I just came across this case-insensitive behavior when trying to regroup include blocks and it was surprising. I'm trying to put system headers after other angle-bracket includes (like for Qt), and I was trying:
- Regex: '^<[a-z_]*>'
- Regex: '^<[A-Za-z_]*>'
Unfortunately, `#include <QWidget>` matches the first regex and so Qt headers get sorted in with system headers. Would it be possible to add the option to do case-sensitive matching after all? Should I open a new issue?
For anyone else who wants case-sensitive matching, I just did discover that `(?-i)` seems to do the trick. I thought it wouldn't because the docs mention extended regex, but I guess it's more extended than I thought! Using `'(?-i)^<[a-z_]*>'` does the trick for me.
CHANGES SINCE LAST ACTION
More information about the cfe-commits