简体   繁体   中英

How to Run PC-Lint on only locally modified files(Not commited on Server of SVN)

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:

# Create object from C source code
file.o: file.c
    gcc                -c $(CFLAGS) -o $@
    wine lint-nt.exe   file.c

Now the file.c will get analysed only when it is changed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM