Force braces off?

I would like to reformat code that looks like this:

to look like this:

It seems like the Force Braces option should have an option for "force braces off". Am I missing an option somewhere?

7 comments
Comment actions Permalink

And you wish to do this because you don't have enough bugs in your code as is? Even in these difficult times job security can't be that hard to come by.

It should be possible to write a handful of structural search and replace strings to do this, if you are bound and determined to.

--Dave Griffith

0
Comment actions Permalink

I wish to do this because I find the code easier to read. If the guy after me doesn't like my code style he can always reformat again.

Having such a feature in the Global Code Style options doesn't seem too unreasonable considering some of the other options listed.

0
Comment actions Permalink

In article <23710508.1121464436472.JavaMail.javamailuser@localhost>,
Bryan Young <no_mail@jetbrains.com> wrote:

I wish to do this because I find the code easier to read. If the guy after
me doesn't like my code style he can always reformat again.


You really like to make diffing out of a version control hell too I
guess.

Having such a feature in the Global Code Style options doesn't seem too
unreasonable considering some of the other options listed.

0
Comment actions Permalink

You really like to make diffing out of a version
control hell too I
guess.


I guess I do. I refactor as I read, and reformat and auto-inspect entire projects before I start working on them. Not being a total idiot, I can still find things in CVS just fine.

It's been more than three years since I actively participated in this forum. I remembered it being much more constructive than this.

0
Comment actions Permalink

And you think that full reformat with different styles may allow you to use VCS easy enough? (at least it good practice to store code inside repository formatted using standard rules, not developer-specific to keep history clear)

0
Comment actions Permalink

Jesus! You guys respond to my cry for constructive help by nagging me more about things you know nothing about!

When I reformat, I DO use the company standard rules! They just didn't exist when this code was written (1997). They weren't even using version control for the first few years. Then they switched VCSs and lost their history three years ago. When I pick up one of these programs, they have very little history. They are written waaay off standard, and often need to have major changes made just to get them running on the latest jdk. Reformatting hurts nothing!

This group has really gone down hill over the last few years. If someone has a constructive answer to my original question, I would love to hear it. Otherwise I'll be ignoring the thread.

0
Comment actions Permalink

I did give a constructive answer. No such tool exists in product. You could create such a tool in about five minutes as a set of structural-search-and-replace rules. No, I'm not going to write those rules for you. No, your request shouldn't be put in product, because outside of your extremely narrow use case, it would be automating a known worst practice, for all the reasons already described. How much more helpful do you want us to be, exactly?

--Dave Griffith

0

Please sign in to leave a comment.