Source-formatter

David Nolden zwabel at googlemail.com
Sun Jan 10 14:26:05 UTC 2010


I've tried the source-formatter after the remake. I think using the mimetype 
for matching is not overly useful, as it distinguishes between "C Header", 
"C++ Header", "C Source", and "C++ Source". In our codebase and in many other 
C++ projects, "C Header", "C++ Header", and "C++ Source" are 
indistinguishable, so having to select a formatter for each of them is 
needlessly complicated.

I think we should change the selection of the source-formatter like this:

The main selection would be the style-name. For each style:
- Allow selecting a set of paths
- For each path, allow selecting a set of wildcards like "*.cpp *.h", which by 
default should just be "*" to select the exact files where the formatting 
should be applied.

Then, every file would be formatted with the rules that match the most 
'specific' path and have a wildcard. This would be fairly easy to implement, 
and would have the potential to finally make the source-formatting really 
useful.

Ideally, we'd also store the rules in-source, right within the paths, so they 
can be shared through VCS systems, but that would be for the future.

Greetings, David




More information about the KDevelop-devel mailing list