Has anyone written some utility that takes a complete stan code file and formats (or at least indents) it according to the guidelines? I have code with a lot of includes, because I want to use the same chunks in several models (and possibly at different levels of indentation). The final stan code is often difficult to read because I cannot indent the includes. According to https://mc-stan.org/docs/2_22/reference-manual/includes-section.html it is possible to add whitespace before includes but when I do it, stanc does not find the file that is supposed to be included.
I use rstan. So I meant that if I create an object of class stanmodel using
model <- rstan::stan_model(file = 'stan_file_which_includes_other_stan_files.stan')
then model@model_code will be a string that describes a complete model without any includes. But the parts that are coming from an #include statement are not indented as I would like. So I was asking for something that formats that.