Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: How to force code formatter across several workspaces?

Tool/software: Code Composer Studio

Hi,

I just discovered the amazing formatter and I would like to use it to standardize my code.

The problem I have at this moment is that I have multiple workspaces (due to multiple projects)

and I would like to start using the same formatter in each project.

How can I force this? I do not want to think about this every time I create a new work space.

Thank you in advance for your answer.

Best regards,

Jeffrey

  • Jeffrey,

    One option would be to export your preferences to a file and then to import them when you create a new workspace.

    File -> Export

    With CCSv8 you will be able to do this when you create a new workspace:

    Regards,

    John

  • John,

    Thank you for your reply.

    This is what I am doing at the moment, but how will I tell a whole team to do this?
    and how will I maintain the settings? (I would like to store the settings in a git or svn solution)

    Is it possible to set a workspace to a specific folder to look for settings?

    Workspace changed do not happen on a weekly basis, so the engineer may forget to import the settings.
    As a programmer, I would like to set it up once and never think about it again. (or just during installation)

    Best regards,

    Jeffrey
  • Jeffrey,

    I can't think of an automated way to handle this. Even if you could the preferences also contain a lot of more personal preferences that you wouldn't always want to override (there is always someone on the team who wants to use the "dark" theme).

    Probably the best thing you could do is as you say put a preference file in source control. You could even link it to your projects. A designated person could keep it up to date. But as you say this would require people to periodically import the preferences. If you keep the preferences you want to control to just the code formatter and other things that fit more with company standards then really they should not change very often at all. Then you won't be messing up the personal preferences frequently either.

    Regards,
    John
  • John,

    at the moment I have about 15 to 20 projects containing MSP430's. (ranging from F149 to F5438A)
    And this is without counting the branch and trunk versions as separate workspaces.

    Putting them all in 1 workspace(The TI prefered way) will make my head spin.

    As part of coding improvements I would like to define standard formatting on all projects.

    I am not keeping all the projects on disk, all the time.
    It would be a big help if I could set the formatter or tell the workspace where to look maybe by default path.
    (Different XML file in the workspace maybe?)

    regards,

    Jeffrey
  • Maybe on Linux you could setup soft links? These settings are stored in <workspace>/.metadata/.plugins/org.eclipse.cdt.ui/dialog_settings.xml

    There is a way to have the settings stored in the project itself. That way you could have them stored in source control and then when a user added it to their workspace they would inherit them for that project. This would require setting them up when creating projects though. And if you made a change you would have to make the change in all projects. Might be able to script that.

    If you have setup the project to have its own formatter settings they are stored in <project folder>/.settings/org.eclipse.cdt.core.prefs

    Regards,
    John
  • John,

    Thank you for your reply.

    It was very helpful, I have solved my problem by creating a formatter project in SVN.

    Store the settings I want in this project, and then add these files as an eternal to the .settings directory of my projects.

    regards,

    Jeffrey