I have a .clang-format file configured, where I want to do the following sorting
#include <stdafx.h>
#include "the_header_of_this_source_file.h"
#include <includes_with_arrow>
#include "includes_with_quote.h"
So far, I have this configuration
IncludeCategories:
- Regex: 'stdafx.h'
Priority: -2
- Regex: '^[<|"].*Prototypes.h'
Priority: 2
- Regex: '^<.*>'
Priority: 2
- Regex: '^".*"'
Priority: 3
IncludeIsMainRegex: '$'
IncludeIsMainSourceRegex: ''
but when formatting the code, it moves the_header_of_this_source_file.h into the quote group (assuming the header is included with quotes), leading me to the following result
#include <stdafx.h>
#include <includes_with_arrow>
// Sorted in alphabetical order
#include "includes_with_quote.h"
#include "the_header_of_this_source_file.h"
How do I prevent this behavior?
Edit
As I understand, the reason comes from the fact, that the header of the file matches the pattern ^".*", therefore its priority is changed. So, maybe there is a way to ignore pattern matching for the main header?