MCPcopy Create free account
hub / github.com/KDE/kdevelop / kdevFormatSource

Function kdevFormatSource

plugins/customscript/customscript_plugin.cpp:273–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273SourceFormatterStyle kdevFormatSource()
274{
275 SourceFormatterStyle result(QStringLiteral("kdev_format_source"));
276 result.setCaption(QStringLiteral("KDevelop: kdev_format_source"));
277 result.setContent(QStringLiteral("kdev_format_source $FILE $TMPFILE"));
278 result.setUsePreview(false);
279 result.setDescription(i18n("Description:<br />"
280 "<b>kdev_format_source</b> is a script bundled with KDevelop "
281 "which allows using fine-grained formatting rules by placing "
282 "meta-files called <b>format_sources</b> into the file-system.<br /><br />"
283 "Each line of the <b>format_sources</b> files defines a list of wildcards "
284 "followed by a colon and the used formatting-command.<br /><br />"
285 "The formatting-command should use <b>$TMPFILE</b> to reference the "
286 "temporary file to reformat.<br /><br />"
287 "Example:<br />"
288 "<b>*.cpp *.h : myformatter $TMPFILE</b><br />"
289 "This will reformat all files ending with <b>.cpp</b> or <b>.h</b> using "
290 "the custom formatting script <b>myformatter</b>.<br /><br />"
291 "Example: <br />"
292 "<b>subdir/* : uncrustify -l CPP -f $TMPFILE -c uncrustify.config -o $TMPFILE</b> <br />"
293 "This will reformat all files in subdirectory <b>subdir</b> using the <b>uncrustify</b> "
294 "tool with the config-file <b>uncrustify.config</b>."));
295
296 result.setMimeTypes(ISourceFormatter::mimeTypesSupportedByBuiltInStyles());
297 return result;
298}
299}
300} // unnamed namespace
301

Callers 1

predefinedStylesMethod · 0.85

Calls 5

setCaptionMethod · 0.80
setUsePreviewMethod · 0.80
setMimeTypesMethod · 0.80
setContentMethod · 0.45
setDescriptionMethod · 0.45

Tested by

no test coverage detected