I am trying to write script to run PC-Lint Static analyzer tool on only locally modified files by user and not on whole project.
For that I need to run Lint
command on all locally modified files
using svn status
svn status -u | grep -w M
command I get list of locally modified files with its full path
For Example if locally modified file is asn1_common_elements.c
, the above svn
command will give output as
M 10014 \Implementations\asn1der\src\asn1_common_elements.c
now I need to take only filename asn1_common_elements.c
and put it with LINT
command as LINT asn1_common_elements.log
(instead of .c
need to change to .log
)
How can I achieve this?
You could use a Makefile's ability to only let the compiler to compile only the changed files.
Do something like this in the Makefile:
Now the file.c will get analysed only when it is changed.