There was already a basic version of this in IdentifierNamingCheck, controlled by an option GetConfigPerFile. This has now been changed to a global option UsePerFileConfig. As there hasn't been a release with GetConfigPerFile, This change shouldn't break anyones config.
Now there is support for this built into the base class directly, along with some basic caching.
As the clang-tidy providers used only have at best directory resolution, this caches based on directory rather than filename. This can potentially save alot of redundant config lookups.