Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18277

Move the IntelliJ Idea code style and inspections configuration to the project's root .idea directory

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Low
    • Resolution: Unresolved
    • 5.x
    • Build
    • None

    Description

      Current State

      Each IDE supported by Cassandra has its own configuration files, which we store in a special 'ide' directory in the project root. idea - for the IntelliJ IDEA configuration, nbproject - for the NetBeans, and there is currently no directory for the Eclipse configuration exist.

      We use ant tasks for initial project setup for a particular IDE:

      • generate-idea-files
      • generate-eclipse-files

      For NetBeans you always choose the ide/nbproject directory as the root of the project, so that the code style configuration for the NetBeans is always shared between developers.

      The Issues With Current State

      There are a few inconveniences we are currently facing that could be resolved by sharing the IntelliJ IDEA code style settings through VCS:

      1. Once a new checkstyle lint is implemented, and the IDE's code style configuration is updated they are not immediately available to a developer. The developer must track the git history to use the latest code style changes and manually copy the updated code style files into the .idea directory, or re-run the generate-idea-files task which will erase any locally saved settings (e.g. words dictionaries);
      2. The code style usually changes by adding new rules one by one, and new checkstyle lints are implemented, so it may differ between release branches. It is a common practice to keep the code style on the same branch so that IntelliJ can use an appropriate configuration for the branch being checked out.
      3. The IntelliJ IDEA code style configuration format that stored the codeStyleSettings.xml file is outdated, from version 2017.3 the codeStyle directory is used. This prevents us from updating the code style configuration without a lot of tedious manual changes.

      The share project settings through VCS approach is well described in the documentation pages:
      https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs

      What To Do

      1. Migrate the IntelliJ code style configuration to the new format, assuming nobody is using such an old version of IntelliJ IDEA;
      2. Move the code style configuration and inspections configuration files to the project's root .idea directory to address the issues described above;
      3. Rely on the IntelliJ IDEA code style for backward compatibility instead of supporting it ourselves;

      Attachments

        Issue Links

          Activity

            People

              mmuzaf Maxim Muzafarov
              mmuzaf Maxim Muzafarov
              Maxim Muzafarov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: