danmar/cppcheck — comment on commit de4a64332efa1cd4e662c4c03057228381f06615
File:  line 0
By kimmov:

> The lib indirectly tells what files the CLI should check because the CLI uses isC and isCPP to determine if a file should be checked or not. But the CLI is not forced to use isC and isCPP. There was no change in behaviour or interface, I just removed some code duplication.

Again, fail. It is client's task to determine what to check, client can then communicate with the user the problems etc. Now the situation is you can **try** to check the file but can't be sure if it really was checked or not, and as which language. The sane interface (if you insist this) would be then to add API for lib to tell if file is checkable or not which client can then use to check if lib likes the file or not.

> If you force clients to specify the language for each file then you complicate the usage. I think most settings should be optional.

You must already fill `Settings` to check a file and set several attributes. One more attribute is not a big deal. There is no optional or mandatory options in `Settings` - only set of attributes you need to set to get the configuration you want. We aren't talking about CLI interface now, but internal API between lib and clients. Are you really mixing these two?

> If we move out the code for determining the language from the lib to every client then we will have copy/pasted code.

You must already copy/paste bunch of code to use lib. E.g. filling the `Settings` structure.