davidvarga / MBeautifier

MBeautifier is a MATLAB source code formatter, beautifier. It can be used directly in the MATLAB Editor and it is configurable.
GNU General Public License v3.0
483 stars 77 forks source link

Add support for folder hierarchy. #79

Open mriesch-tum opened 5 years ago

mriesch-tum commented 5 years ago

As there are thoughts about rewriting the whole project, I would like to add some feature requests. This way they can be already discussed and -- if desired -- they can be integrated from the very beginning of the new project. (Alternatively, of course, they can be implemented in the existing version).

Given a folder structure with many MATLAB files in it, it would be nice to have a function that applies the format in-place for each file. I think it would help the developers a lot to have such a batch formatting tool. The main application here, however, is continuous integration. In such a scenario, all files can be formatted and differences can be easily detected. This feature should include a way to exclude certain files or directories from formatting. I have some first code lying around, if desired I can make it available.

Related, but maybe a different issue: It would be nice if the script considered a given settings file in the project root (for project specific settings). Maybe the settings can be overwritten by another settings file in a subdirectory. In summary, the recursive formatting function mentioned above scans for a settings file in the current directory, in a top-level directory, and finally in the MBeautifier settings directory.