From 7b2bc62431e14dac831be9a374c89d20ca888fbe Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:34:05 +0500 Subject: [PATCH 1/6] HDDS-12365. Sync IJ code style and run config via git --- .gitignore | 6 +- .idea/codeStyles/Project.xml | 60 +++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++ .../CsiServer.xml => .run/CsiServer.run.xml | 0 .../Datanode1-ha.run.xml | 0 .../Datanode1.xml => .run/Datanode1.run.xml | 0 .../Datanode2-ha.run.xml | 0 .../Datanode2.xml => .run/Datanode2.run.xml | 0 .../Datanode3-ha.run.xml | 0 .../Datanode3.xml => .run/Datanode3.run.xml | 0 .../FreonStandalone.run.xml | 0 .../OzoneFsShell-ha.run.xml | 0 .../OzoneFsShell.run.xml | 0 .../OzoneManager-ha.run.xml | 0 .../OzoneManager.run.xml | 0 .../OzoneManagerInit-ha.run.xml | 0 .../OzoneManagerInit.run.xml | 0 .../OzoneShell-ha.run.xml | 0 .../OzoneShell.xml => .run/OzoneShell.run.xml | 0 .../PrimordialSCM-ha.run.xml | 0 .../PrimordialSCMInit-ha.run.xml | 0 .../Recon-ha.xml => .run/Recon-ha.run.xml | 0 .../Recon.xml => .run/Recon.run.xml | 0 .../S3Gateway.xml => .run/S3Gateway.run.xml | 0 .../Scm2-ha.xml => .run/Scm2-ha.run.xml | 0 .../Scm2Bootstrap-ha.run.xml | 0 .../Scm3-ha.xml => .run/Scm3-ha.run.xml | 0 .../Scm3Bootstrap-ha.run.xml | 0 .../ScmRoles.xml => .run/ScmRoles.run.xml | 0 .../StorageContainerManager.run.xml | 0 .../StorageContainerManagerInit.run.xml | 0 .../intellij/install-runconfigs.sh | 21 ------- .../dev-support/intellij/ozone-style.xml | 57 ------------------ 33 files changed, 70 insertions(+), 79 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml rename hadoop-ozone/dev-support/intellij/runConfigurations/CsiServer.xml => .run/CsiServer.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1-ha.xml => .run/Datanode1-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1.xml => .run/Datanode1.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2-ha.xml => .run/Datanode2-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2.xml => .run/Datanode2.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3-ha.xml => .run/Datanode3-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3.xml => .run/Datanode3.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/FreonStandalone.xml => .run/FreonStandalone.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell-ha.xml => .run/OzoneFsShell-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell.xml => .run/OzoneFsShell.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager-ha.xml => .run/OzoneManager-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager.xml => .run/OzoneManager.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit-ha.xml => .run/OzoneManagerInit-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit.xml => .run/OzoneManagerInit.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell-ha.xml => .run/OzoneShell-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell.xml => .run/OzoneShell.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCM-ha.xml => .run/PrimordialSCM-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCMInit-ha.xml => .run/PrimordialSCMInit-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Recon-ha.xml => .run/Recon-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Recon.xml => .run/Recon.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/S3Gateway.xml => .run/S3Gateway.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Scm2-ha.xml => .run/Scm2-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Scm2Bootstrap-ha.xml => .run/Scm2Bootstrap-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Scm3-ha.xml => .run/Scm3-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/Scm3Bootstrap-ha.xml => .run/Scm3Bootstrap-ha.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/ScmRoles.xml => .run/ScmRoles.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManager.xml => .run/StorageContainerManager.run.xml (100%) rename hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManagerInit.xml => .run/StorageContainerManagerInit.run.xml (100%) delete mode 100755 hadoop-ozone/dev-support/intellij/install-runconfigs.sh delete mode 100644 hadoop-ozone/dev-support/intellij/ozone-style.xml diff --git a/.gitignore b/.gitignore index ce7a473130a6..ef0f81bfd1b2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ *.suo *.vcxproj.user *.patch -.idea .svn .classpath .project @@ -20,6 +19,11 @@ build dependency-reduced-pom.xml make-build-debug +# IntelliJ IDEA +.idea +!.idea/codeStyles/codeStyleConfig.xml +!.idea/codeStyles/Project.xml + # Filesystem contract test options and credentials auth-keys.xml azure-auth-keys.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 000000000000..b5296bafd51a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000000..127f806938c4 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/CsiServer.xml b/.run/CsiServer.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/CsiServer.xml rename to .run/CsiServer.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1-ha.xml b/.run/Datanode1-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1-ha.xml rename to .run/Datanode1-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1.xml b/.run/Datanode1.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode1.xml rename to .run/Datanode1.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2-ha.xml b/.run/Datanode2-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2-ha.xml rename to .run/Datanode2-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2.xml b/.run/Datanode2.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode2.xml rename to .run/Datanode2.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3-ha.xml b/.run/Datanode3-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3-ha.xml rename to .run/Datanode3-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3.xml b/.run/Datanode3.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Datanode3.xml rename to .run/Datanode3.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/FreonStandalone.xml b/.run/FreonStandalone.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/FreonStandalone.xml rename to .run/FreonStandalone.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell-ha.xml b/.run/OzoneFsShell-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell-ha.xml rename to .run/OzoneFsShell-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell.xml b/.run/OzoneFsShell.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneFsShell.xml rename to .run/OzoneFsShell.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager-ha.xml b/.run/OzoneManager-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager-ha.xml rename to .run/OzoneManager-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager.xml b/.run/OzoneManager.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManager.xml rename to .run/OzoneManager.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit-ha.xml b/.run/OzoneManagerInit-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit-ha.xml rename to .run/OzoneManagerInit-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit.xml b/.run/OzoneManagerInit.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneManagerInit.xml rename to .run/OzoneManagerInit.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell-ha.xml b/.run/OzoneShell-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell-ha.xml rename to .run/OzoneShell-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell.xml b/.run/OzoneShell.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/OzoneShell.xml rename to .run/OzoneShell.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCM-ha.xml b/.run/PrimordialSCM-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCM-ha.xml rename to .run/PrimordialSCM-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCMInit-ha.xml b/.run/PrimordialSCMInit-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/PrimordialSCMInit-ha.xml rename to .run/PrimordialSCMInit-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Recon-ha.xml b/.run/Recon-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Recon-ha.xml rename to .run/Recon-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Recon.xml b/.run/Recon.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Recon.xml rename to .run/Recon.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/S3Gateway.xml b/.run/S3Gateway.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/S3Gateway.xml rename to .run/S3Gateway.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm2-ha.xml b/.run/Scm2-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm2-ha.xml rename to .run/Scm2-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm2Bootstrap-ha.xml b/.run/Scm2Bootstrap-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm2Bootstrap-ha.xml rename to .run/Scm2Bootstrap-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm3-ha.xml b/.run/Scm3-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm3-ha.xml rename to .run/Scm3-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/Scm3Bootstrap-ha.xml b/.run/Scm3Bootstrap-ha.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/Scm3Bootstrap-ha.xml rename to .run/Scm3Bootstrap-ha.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/ScmRoles.xml b/.run/ScmRoles.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/ScmRoles.xml rename to .run/ScmRoles.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManager.xml b/.run/StorageContainerManager.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManager.xml rename to .run/StorageContainerManager.run.xml diff --git a/hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManagerInit.xml b/.run/StorageContainerManagerInit.run.xml similarity index 100% rename from hadoop-ozone/dev-support/intellij/runConfigurations/StorageContainerManagerInit.xml rename to .run/StorageContainerManagerInit.run.xml diff --git a/hadoop-ozone/dev-support/intellij/install-runconfigs.sh b/hadoop-ozone/dev-support/intellij/install-runconfigs.sh deleted file mode 100755 index fc877bdde622..000000000000 --- a/hadoop-ozone/dev-support/intellij/install-runconfigs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -SRC_DIR="$SCRIPT_DIR/runConfigurations" -DEST_DIR="$SCRIPT_DIR/../../../.idea/runConfigurations/" -mkdir -p "$DEST_DIR" -#shellcheck disable=SC2010 -ls -1 "$SRC_DIR" | grep -v ozone-site.xml | xargs -n1 -I FILE cp "$SRC_DIR/FILE" "$DEST_DIR" diff --git a/hadoop-ozone/dev-support/intellij/ozone-style.xml b/hadoop-ozone/dev-support/intellij/ozone-style.xml deleted file mode 100644 index 7ad620607249..000000000000 --- a/hadoop-ozone/dev-support/intellij/ozone-style.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file From c59a80d19b9d8a7940b5e41ddf1eefb645f1a8bc Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:41:57 +0500 Subject: [PATCH 2/6] HDDS-12365. Updated CONTRIBUTING.md --- CONTRIBUTING.md | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a1eeda8cf13..7e1ba9aece28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -166,16 +166,12 @@ As Ozone uses Apache Maven it can be developed from any IDE. IntelliJ IDEA is a ### Run Ozone from IntelliJ -Ozone components depends on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime. +Ozone components depend on maven classpath. We generate classpath descriptor from the maven pom.xml files to use exactly the same classpath at runtime. -As a result, it's easy to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. +As a result, it's straightforward to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. -To start Ozone from IntelliJ: - -1. Stop your IDE -2. Execute the `./hadoop-ozone/dev-support/intellij/install-runconfigs.sh` helper script. -3. Start the IDE -4. New runner definitions are available from the Run menu. +Ozone project already has pre-defined run configurations shared via .run folder. +They will be automatically imported into IDE on project import. You can use the installed Run configurations in the following order: @@ -190,12 +186,9 @@ You can use the installed Run configurations in the following order: Checkstyle plugin may help to detect violations directly from the IDE. -1. Install `Checkstyle+IDEA` plugin from `File` -> `Settings` -> `Plugins` -2. Open `File` -> `Settings` -> `Other settings` -> `Checkstyle` and Add (`+`) a new `Configuration File` - * Description: `Ozone` - * Use a local checkstyle `./hadoop-hdds/dev-support/checkstyle/checkstyle.xml` -3. Check the `pom.xml` for the current version of the used checkstyle and use the same version with the plugin (`File` -> `Settings` -> `Other settings` -> `Checkstyle`) -4. Open the _Checkstyle Tool Window_, select the `Ozone` rule and execute the check +Ozone checkstyle is shared via standard .idea/codeStyle folder and will be automatically imported when the project is opened. + +To use checkstyle, you need to select "Stored in project" scheme in Editor - Code Style settings. ### Common problems From 8812d9576b3d4b1b6f22372d757ffa818ffe32c5 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:46:49 +0500 Subject: [PATCH 3/6] HDDS-12365. Fix CONTRIBUTING.md --- CONTRIBUTING.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e1ba9aece28..6e1410736394 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,13 +125,13 @@ Basic code conventions followed by Ozone: These are checked by tools like Checkstyle and RAT. -For IntelliJ users, it is recommended to import and select the Code Style scheme located at: +For IntelliJ users, Ozone checkstyle is shared via standard configuration folder and will be automatically imported when the project is open: ``` -./hadoop-ozone/dev-support/intellij/ozone-style.xml +./.idea/codeStyle ``` -See https://www.jetbrains.com/help/idea/configuring-code-style.html#import-code-style for detailed instructions. +See https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs for detailed instructions. ### Check your contribution @@ -170,7 +170,12 @@ Ozone components depend on maven classpath. We generate classpath descriptor fro As a result, it's straightforward to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. -Ozone project already has pre-defined run configurations shared via .run folder. +Ozone project already has pre-defined run configurations shared via standard IDE folder for run configurations: + +``` +./.run +``` + They will be automatically imported into IDE on project import. You can use the installed Run configurations in the following order: @@ -186,9 +191,12 @@ You can use the installed Run configurations in the following order: Checkstyle plugin may help to detect violations directly from the IDE. -Ozone checkstyle is shared via standard .idea/codeStyle folder and will be automatically imported when the project is opened. - -To use checkstyle, you need to select "Stored in project" scheme in Editor - Code Style settings. +1. Install `Checkstyle+IDEA` plugin from `File` -> `Settings` -> `Plugins` +2. Open `File` -> `Settings` -> `Other settings` -> `Checkstyle` and Add (`+`) a new `Configuration File` + * Description: `Ozone` + * Use a local checkstyle `./hadoop-hdds/dev-support/checkstyle/checkstyle.xml` +3. Check the `pom.xml` for the current version of the used checkstyle and use the same version with the plugin (`File` -> `Settings` -> `Other settings` -> `Checkstyle`) +4. Open the _Checkstyle Tool Window_, select the `Ozone` rule and execute the check ### Common problems From f1ab30468ba9e65e2c847f26081f5ee121920dfb Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Fri, 21 Feb 2025 08:35:00 +0500 Subject: [PATCH 4/6] HDDS-12365. Migrate to .editorconfig --- .editorconfig | 61 ++++++++++++++++++++++++++++ .gitignore | 6 +-- .idea/codeStyles/Project.xml | 60 --------------------------- .idea/codeStyles/codeStyleConfig.xml | 5 --- CONTRIBUTING.md | 6 +-- 5 files changed, 63 insertions(+), 75 deletions(-) create mode 100644 .editorconfig delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..2dc3fbae7e6d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,61 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = +ij_wrap_on_typing = false + +[*.java] +ij_java_indent_case_from_switch = false +ij_java_call_parameters_new_line_after_left_paren = false +ij_java_call_parameters_right_paren_on_new_line = false +ij_java_call_parameters_wrap = normal +ij_java_method_parameters_new_line_after_left_paren = false +ij_java_method_parameters_right_paren_on_new_line = false +ij_java_method_parameters_wrap = normal +ij_java_resource_list_new_line_after_left_paren = false +ij_java_resource_list_right_paren_on_new_line = false +ij_java_resource_list_wrap = normal +ij_java_extends_list_wrap = normal +ij_java_throws_list_wrap = normal +ij_java_extends_keyword_wrap = normal +ij_java_throws_keyword_wrap = normal +ij_java_method_call_chain_wrap = normal +ij_java_binary_operation_wrap = normal +ij_java_ternary_operation_wrap = normal +ij_java_for_statement_wrap = normal +ij_java_array_initializer_wrap = normal +ij_java_assignment_wrap = normal +ij_java_assert_statement_wrap = normal +ij_java_if_brace_force = always +ij_java_do_while_brace_force = always +ij_java_while_brace_force = always +ij_java_for_brace_force = always +ij_java_parameter_annotation_wrap = normal +ij_java_variable_annotation_wrap = normal +ij_java_enum_constants_wrap = normal +ij_java_blank_lines_after_imports = 1 +ij_java_blank_lines_before_imports = 1 +ij_java_class_count_to_use_import_on_demand = 9999 +ij_java_packages_to_use_import_on_demand = +ij_java_imports_layout = $*,|,* +ij_java_layout_static_imports_separately = true +ij_java_use_single_class_imports = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + diff --git a/.gitignore b/.gitignore index ef0f81bfd1b2..ce7a473130a6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.suo *.vcxproj.user *.patch +.idea .svn .classpath .project @@ -19,11 +20,6 @@ build dependency-reduced-pom.xml make-build-debug -# IntelliJ IDEA -.idea -!.idea/codeStyles/codeStyleConfig.xml -!.idea/codeStyles/Project.xml - # Filesystem contract test options and credentials auth-keys.xml azure-auth-keys.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index b5296bafd51a..000000000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 127f806938c4..000000000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e1410736394..adf2becc539a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,11 +125,7 @@ Basic code conventions followed by Ozone: These are checked by tools like Checkstyle and RAT. -For IntelliJ users, Ozone checkstyle is shared via standard configuration folder and will be automatically imported when the project is open: - -``` -./.idea/codeStyle -``` +Ozone checkstyle is shared via .editorconfig configuration file and will be automatically imported when the project is open. See https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs for detailed instructions. From f12da5d313308ce5c860e544ae93965f673cca73 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:53:38 +0500 Subject: [PATCH 5/6] Improve CONTRIBUTING.MD Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com> --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adf2becc539a..dcd525d09d15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,7 +125,7 @@ Basic code conventions followed by Ozone: These are checked by tools like Checkstyle and RAT. -Ozone checkstyle is shared via .editorconfig configuration file and will be automatically imported when the project is open. +Ozone code style is shared via `.editorconfig` configuration file and will be automatically imported when the project is opened. See https://www.jetbrains.com/help/idea/configure-project-settings.html#share-project-through-vcs for detailed instructions. @@ -166,13 +166,13 @@ Ozone components depend on maven classpath. We generate classpath descriptor fro As a result, it's straightforward to start _all_ the components from IDE as the right classpath (without provided scope) has already been set. -Ozone project already has pre-defined run configurations shared via standard IDE folder for run configurations: +Ozone project has pre-defined run configurations shared via standard IDE folder for run configurations: ``` -./.run +.run ``` -They will be automatically imported into IDE on project import. +They will be automatically added to the IDE on project import. You can use the installed Run configurations in the following order: From e6f9955e44815cd531859826346ce6416015a363 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Fri, 21 Feb 2025 15:54:39 +0500 Subject: [PATCH 6/6] HDDS-12365. Fix .editorconfig --- .editorconfig | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2dc3fbae7e6d..c32bec2c9131 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +root = true + [*] charset = utf-8 end_of_line = lf indent_size = 2 indent_style = space -insert_final_newline = false +insert_final_newline = true max_line_length = 120 tab_width = 2 ij_continuation_indent_size = 4 @@ -58,4 +75,3 @@ ij_editorconfig_space_after_comma = true ij_editorconfig_space_before_colon = false ij_editorconfig_space_before_comma = false ij_editorconfig_spaces_around_assignment_operators = true -