Menu

#125 How to create a null configuration

Future Release
closed
nobody
None
5
2016-09-25
2010-11-20
No

Hi,

Is there a way to generate a null configuration? This is a configuration file
that will not affect the output at all, thereby providing a baseline in which
all the options are false/off/0. That way, I can selectively turn options on
to fix/detect specific coding styles without affecting all other aspects.

The default configuration I get from uncrustify does not have the desired null
effect.

I would like use uncrustify in a project without having to make everyone else
use it. They can adopt it in time, but meantime, I would like to use uncrustify
without stepping on their favourite coding styles.

One use of this is update code incrementally. For example, add spaces to '=' on
the team's code without breaking their favourite comment scheme etc.

UniversalIndent is ideal for visually tuning small code. For looking at the entire
code base and study the effect of an option, uncrustify can be batched more easily.

Thanks,

Discussion

  • Ben Gardner

    Ben Gardner - 2011-01-01

    No, it isn't possible to configure uncrustify to not change anything.
    See my comments in tracker item 3148081.

    Since I don't consider this a bug, I'm moving this to feature requests.

     
  • Sébastien Wilmet

    A null config, or a way to change only a specific aspect of the source code, would be really useful, and would make Uncrustify much more powerful.

    I think there is an almost infinite number of coding styles in the wild, trying to fit every project is near to impossible.

    Simple use case: I want to add curly braces around one-line if/else/for/while/etc blocks. Only that, as a first step. But it takes a lot of time to find a good Uncrustify config file for my project, because there are so many options, and I'm still not sure that I can find a good Uncrustify config, maybe some options are missing.

    I think all the code for scanning/parsing the source file is there, it "just" need to be used differently to apply only certain options, not all. Easier said than done, of course. But if it is done, Uncrustify could be used by many more projects. And it would not be a big problem if Uncrustify doesn't have a certain option for a certain coding style, that part of the code could simply be ignored.

     
  • Sébastien Wilmet

    BTW GNU Indent has the same problem.

     
  • Guy Maurel

    Guy Maurel - 2016-09-25
    • status: open --> closed
    • Group: --> Future Release
     
  • Guy Maurel

    Guy Maurel - 2016-09-25
     
MongoDB Logo MongoDB