0

I have a project where every plugin project has specific format settings. It makes perfectly sense to use a single format setting for versioned source code but when working local I want to use my own formatter. I want to be able to say: It's okay that you have a project specific setting but I want to overwrite it with this global setting here. I want it always off when I'm working on it and only when I check in a new version of a file I want to use the project-specific format setting.

How can I temporarily deactivate the project specific formatting settings without doing it manually every time?

4
  • You want it temporary deactivate but you don't want do do it manually? In which Situations you want it off? Commented Dec 2, 2015 at 8:04
  • The project has about 50 pluging and each has a project specific setting. I want to be able to say: It's okay that you have a project specific setting but I want to overwrite it with this global setting here. I'm afraid it only works the other way around but asking can't hurt. I want it alway off when I'm working on it and only when I check in a new version of a file I want to use the project specific setting. Commented Dec 2, 2015 at 8:32
  • What SCM tool are you using? cvs, svn, git? Commented Dec 2, 2015 at 13:41
  • By the way, why not just avoid using the code formatter altogether? You don't have to invoke it on code you're working on. Commented Dec 2, 2015 at 13:42

1 Answer 1

1

Besides clicking on every single Project and changing it, there is no Built-In way to do it.

You could do this:

The Configuration for the Project specific formatter is (at least in my Eclipse Mars 4.5.0) saved in the File <your-project>.settings\org.eclipse.jdt.core.prefs.

You could make a Backup of all those Files (e.g. save them as org.eclipse.jdt.core.prefs.project-specific) with the Project Specific Settings.

Then change all Projects manually to Workspace Settings and make another Backup (org.eclipse.jdt.core.prefs.workspace).

Use then a Batch File to overwrite the default org.eclipse.jdt.core.prefs with the Settings you want, after a Workspace Refresh Eclipse should register the new Settings.

If you use Git, you could use the stash function to change the Files back and forth, instead of backing up Files and a Batch File.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.