Please describe the feature you’d like to see added.
Currently test/lint/lint-logs.py
tries to parse the C++ manually which is prone to flaws. For example it does not support expressions that span more than one line and would be happy if there is \n"
anywhere (on the single line it checks). For example:
0 LogPrintLevel(BCLog::PROXY,
1 BCLog::Level::Debug,
2 "This is fine, but lint-logs.py will report error\n");
0 LogPrintLevel(BCLog::PROXY, BCLog::Level::Debug, "Not ok\n"
1 " but will be reported as ok");
0 LogPrintLevel(BCLog::PROXY, BCLog::Level::Debug, "even more /* Continued */ no newline, but is ok");
0 /* LogPrintLevel() inside comment causes an error */
Is your feature related to a problem, if so please describe it.
lint-logs.py
requires to either write everything on line line or add /* Continued */
comment.
Describe the solution you’d like
It should be possible to use libclang to properly parse the C++ code. Then the check should be something like:
0for each call to `LogPrintLevel()`:
1 get the third argument:
2 it should be a string
3 its last two chars should be `\` and `n`
Describe any alternatives you’ve considered
No response
Please leave any additional context
No response