This patch depends on http://reviews.llvm.org/D14191
Details
Diff Detail
Event Timeline
Addressed review comments.
clang-tidy/ClangTidyOptions.h | ||
---|---|---|
89–93 | Though it's a less frequently used option, but seems to be good for consistency (with the clang tools' -extra-arg/-extra-arg-before pair of options) and for completeness. I've extended the test to verify both options and their interaction. |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | My concern is still with the Filename in the arg callback. I'd like to understand the full use-case better. |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | We need the filename to retrieve the proper ClangTidyOptions for each file. Context.setCurrentFile is used to specify which file should getOptions return the options for. |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | But the extra-args don't depend on the file; it seems like the filename in the callback is only used to be notified when the file changes? |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | The thing is that they do depend on the file, because we're implementing their configuration from the config file, and different translation units can have different corresponding configuration files. |
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | Ok, now I get it. I completely didn't expect an interface that needs a setCurrentFile so it can getOptions afterwards for that file. |
PTAL
clang-tidy/ClangTidy.cpp | ||
---|---|---|
382 | The interface should be clearer, if you think about the possibility of having different options for different files. Also, the documentation on the corresponding methods should help. But adding getOptionsForFile doesn't hurt. |
Ok, this patch LG. I'd really like to get rid of the current-file-dependent stuff in ClangTidyOptions though :)
This doesn't seem to be the right place for this #include.