docs/requirements/output-generated-file-filter.md
Machine-generated sources - Qt moc output, protobuf stubs, and the output of
other code generators - often should not appear in the compilation database, so
that linters and editors act only on hand-written code. A user can list
filename patterns that exclude (or re-include) matching source files. This is
off by default: with no such configuration the output is unchanged.
output-source-directory-filter).
A file matched by no pattern rule is included.main.cpp and moc_window.cpp, and a configuration
excluding the basename pattern for moc_*.cpp, when bear runs, then the
database contains main.cpp only.src/main.cpp and generated/main.cpp, and a
configuration excluding the pattern generated/*.cpp, when bear runs, then
the database contains src/main.cpp and omits generated/main.cpp: the
pattern contains a path separator, so it is matched against the full source
path rather than the basename.main.cpp and util.cpp, and a configuration with
an exclude rule for *.cpp followed by an include rule for main.cpp, when
bear runs, then the database contains main.cpp only: the later include
rule re-includes it (last matching rule wins), while util.cpp stays
excluded.src/main.cpp and src/moc_window.cpp, a directory
rule including src, and a file-pattern rule excluding moc_*.cpp, when
bear runs, then the database contains src/main.cpp and omits
src/moc_window.cpp: an entry is emitted only when both the directory rules
and the file-pattern rules accept it.