When I run a static analysis tool over my codebase, and I get results like this:
...
arch/powerpc/kernel/time.c:102:5: warning: symbol 'decrementer_max' was not declared. Should it be static?
arch/powerpc/kernel/time.c:138:1: warning: symbol 'rtc_lock' was not declared. Should it be static?
arch/powerpc/kernel/time.c:361:37: warning: implicit cast to nocast type
...
I want to keep track of the number of warnings and where they are in the code as people make changes.
I could just diff
the results of the static analysis runs, but then if someone inserts some code in time.c
at line 50, the warnings above will move, and because the line numbers have changed, diff will tell me that they've changed.
How should I go about comparing these in a way that deals with movement of code within a file?
Googling for 'smart diff', etc hasn't been productive: they're mostly smart diffs of code rather than smart diff of logs. Log analysis tools like Greylog or Kibana also seem like a poor fit, designed more for different and more general analysis rather than for this quite specific task.
Is there something obvious that I'm missing? Or is this a problem where I should expect to be writing my own tooling?
I had a go with a slightly simpler setup - as @ajd suggested, parsing the messages, and doing line-number-insensitive matching.
The code is up at https://github.com/daxtens/smart-sparse-diff