Bug 340596 - Reformat Source does not work with configuration: KDevelop:kdev_format_source
Summary: Reformat Source does not work with configuration: KDevelop:kdev_format_source
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: All editors (show other bugs)
Version: 4.7.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 10:23 UTC by Hubiao Yang
Modified: 2016-09-13 11:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hubiao Yang 2014-11-03 10:23:57 UTC
When I configure Kdevelop to use Source formatter – Custom Script Formatter - KDevelop:kdev_format_source, it has no effect when I click Edit – Reformat source. It seems may be the kdev_format_source is not called.

I only have this problem under Kubuntu 14.04. For Kubuntu 12.04 and Kdevelop  4.6/4.7 and KDevPlatform 4.6/4.7, it is fine.

For further information, can anyone tell me how I can get the standard output or warnings? I want to send you more bugs report, but I donot know where to see it.

Reproducible: Always

Steps to Reproduce:
1. Settings->Configure KDevelop->Source Formatter->Custom Script Formatter, choose KDevelop:kdev_format_source. Save the setting.
2. Prepare "format_source" and " uncrustify configuration" files. Example files are included in Additional infomation
3. Open one of the c code source file. Edit->Reformat Source

Actual Results:  
The code is not reformatted.

Expected Results:  
The code should be refomatted or changed.

=========format_source========
# Use uncrustify.cfg as the configuration file
uncrustify -f ${ORIGFILE} -c uncrustify.cfg -o ${ORIGFILE}.formatted

======uncrustify.cfg=======
#
# uncrustify config file for the linux kernel
#

indent_with_tabs    = 2     # 1=indent to level only, 2=indent with tabs
input_tab_size      = 8     # original tab size

#
# inter-symbol newlines
#
nl_do_brace         = force     # "do {" vs "do \n {"
nl_if_brace         = force     # "if () {" vs "if () \n {"
nl_for_brace        = force     # "for () {" vs "for () \n {"
nl_else_brace       = force     # "else {" vs "else \n {"
nl_while_brace      = force     # "while () {" vs "while () \n {"
nl_switch_brace     = force     # "switch () {" vs "switch () \n {"
nl_brace_else       = force     # "} else" vs "} \n else" - cuddle else
nl_fcall_brace      = force     # "list_for_each() {" vs "list_for_each()\n{"
nl_fdef_brace       = force     # "int foo() {" vs "int foo()\n{"
nl_after_return     = true
nl_after_brace_close    = true

align_pp_define_span    = 1
Comment 1 Anton Anikin 2016-09-13 11:57:35 UTC
fix your settings:

=========format_source========
uncrustify -l CPP -f ${TMPFILE} -c  uncrustify.cfg -o ${TMPFILE}