LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-30-2017, 07:37 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
uncrustify/mystyle.cfg Can I add functions to Uncrustify


Hi group,
I need a way to add function to Uncrustify. Specifically, I wish to make him change "if (" to "if( " as well as while, for, etc. I would also like to make the closing brace on the last line of a group, not on a newline.
The config file for Uncrustify is daunting.

I know this is not an accepted style but it is what I need to be able to read my code. I AM DYSLEXIC! Trolls need not reply!

Thanks for your time and your replies.
 
Old 03-31-2017, 11:25 AM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
You might try this config file instead of the default: https://github.com/uncrustify/uncrus...cs/ben.cfg.txt

For example, to remove the space in "if (" change "force" on line 61 to "remove":
Code:
sp_before_sparen		= remove		# "if (" vs "if("
 
Old 04-01-2017, 02:43 PM   #3
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by norobro View Post
You might try this config file instead of the default: https://github.com/uncrustify/uncrus...cs/ben.cfg.txt

For example, to remove the space in "if (" change "force" on line 61 to "remove":
Code:
sp_before_sparen		= remove		# "if (" vs "if("
Thanks for your post bit iy fails here:
Code:
uncrustify --version
uncrustify 0.64.517-g91f2ff0

uncrustify -c ben.cfg.txt -o test.unc
ben.cfg.txt:98 Unknown symbol 'align_var_def_star'
Then hangs, needed C-c to recover.
 
Old 04-01-2017, 03:53 PM   #4
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
So I found a config file that gives me the Lisp style I want except for one little thing, I want this:
Code:
  if( ( Term = initscr() ) == NULL)  {
     fprintf( stderr, "Initscr error initializing ncurses.\n" );
     exit( EXIT_FAILURE );  }
and I get this:
Code:
  if( ( Term = initscr() ) == NULL)  {
      fprintf( stderr, "Initscr error initializing ncurses.\n" );
      exit( EXIT_FAILURE );
      }
Anyone know the magic word I need to change?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[syslinux.cfg] Add option to list hardware? littlebigman Linux - Software 2 03-15-2013 10:14 AM
I couldn't receive mail to myeamil@gmail.com,but i changed my mail add in contact.cfg parthipan Linux - Server 0 06-15-2012 05:12 AM
how do i add Fedora 15 to the grub.cfg menu baronobeefdip Debian 1 04-10-2011 01:52 PM
[SOLVED] how to the give path of the part.cfg file in %include command in ks.cfg. YOGESHAS87 Linux - Newbie 2 01-11-2011 04:33 AM
how to add color text in ks.cfg (kickstart) kernel99 Linux - General 0 08-22-2005 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration