Skip to content
Snippets Groups Projects
Commit 6b598e34 authored by Giovanni Bussi's avatar Giovanni Bussi Committed by Giovanni Bussi
Browse files

Add check astyle

Check first if astyle is present. In this way, when astyle is not compiled,
we get a single error instead of one error per file.
parent fe84353c
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,10 @@ BEGIN{
# create tmp dir for future usage
"mktemp -dt plumed.XXXXXX" | getline tmpdir
# checking astyle presence
astyle_available=!system(astyle " --version > /dev/null 2> /dev/null")
if(!astyle_available) error("astyle_not_available","astyle not available on this system, skipping astyle checks")
}
# for each input file
......@@ -198,7 +202,7 @@ BEGINFILE{
# checks that are done only on some modules will be skipped if the module name is not known
if((filetype=="source" || filetype=="header") && !module) information("missing_module_name","module name is not know, some check will be skipped");
if(filetype=="source" || filetype=="header"){
if(astyle_available && (filetype=="source" || filetype=="header")){
tempfile = tmpdir "/astyle"
system(astyle " --options=" astyle_options " < " FILENAME " > " tempfile)
s=system("diff -q " FILENAME " " tempfile ">/dev/null 2>/dev/null")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment