From 02442f42d0509a9d5f8d0fff140b8f4fed300abe Mon Sep 17 00:00:00 2001 From: homksei Date: Tue, 16 Jul 2024 23:26:14 +0200 Subject: [PATCH 1/4] chore(workflows): add `editorconfig-checker` --- .ci/env/editorconfig-checker.sh | 32 ++++++++++++++++++++++++++++++++ .ci/pipeline/ci.yml | 9 +++++++-- .ecrc | 17 +++++++++++++++++ .editorconfig | 7 +++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 .ci/env/editorconfig-checker.sh create mode 100644 .ecrc create mode 100644 .editorconfig diff --git a/.ci/env/editorconfig-checker.sh b/.ci/env/editorconfig-checker.sh new file mode 100755 index 00000000000..4dee0d4a743 --- /dev/null +++ b/.ci/env/editorconfig-checker.sh @@ -0,0 +1,32 @@ +#!/bin/bash +#=============================================================================== +# Copyright contributors to the oneDAL project +# +# Licensed 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. +#=============================================================================== + +VERSION=v3.0.3 +NAME=ec-linux-amd64 +ASSET=$NAME.tar.gz + +# Download +export SHA256="fc698b0bf5bca0d42e28dd59d72e25487a51f645ca242c5f74bae975369f16aa $ASSET" +wget https://github.com/editorconfig-checker/editorconfig-checker/releases/download/$VERSION/$ASSET +echo "${SHA256}" | sha256sum --check + +# Install +tar -xzf $ASSET +mv bin/$NAME /usr/local/bin/editorconfig-checker + +# Clean up the downloaded archive +rm $ASSET diff --git a/.ci/pipeline/ci.yml b/.ci/pipeline/ci.yml index e8393098b3f..bf957f2918b 100755 --- a/.ci/pipeline/ci.yml +++ b/.ci/pipeline/ci.yml @@ -30,17 +30,22 @@ variables: SYSROOT_OS: 'jammy' jobs: -- job: 'ClangFormat' +- job: 'FormattersChecks' pool: vmImage: '$(VM_IMAGE)' steps: - script: | .ci/env/apt.sh clang-format - displayName: 'apt-get' + .ci/env/editorconfig-checker.sh + displayName: 'Install Dependencies' - script: | .ci/scripts/clang-format.sh displayName: 'clang-format check' failOnStderr: true + - script: | + editorconfig-checker + displayName: 'editorconfig-checker' + failOnStderr: true - job: 'LinuxMakeGNU_MKL' timeoutInMinutes: 0 diff --git a/.ecrc b/.ecrc new file mode 100644 index 00000000000..ece51ea8557 --- /dev/null +++ b/.ecrc @@ -0,0 +1,17 @@ +{ + "Verbose": false, + "Debug": false, + "IgnoreDefaults": false, + "SpacesAftertabs": false, + "NoColor": false, + "AllowedContentTypes": [], + "PassedFiles": [], + "Disable": { + "EndOfLine": false, + "Indentation": false, + "InsertFinalNewline": false, + "TrimTrailingWhitespace": false, + "IndentSize": true, + "MaxLineLength": false + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..439e9a94e93 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*.{py,pl,pm,i,inc,c,cpp,h,hpp,s,f,f77,f90,fi,java}] +indent_style = space +trim_trailing_whitespace = true +insert_final_newline = true +# max_line_length = 150 From 49d4fb10445435c2ca14acdcc8f6d720179d5332 Mon Sep 17 00:00:00 2001 From: homksei Date: Thu, 25 Jul 2024 10:43:05 +0200 Subject: [PATCH 2/4] chore(workflows): update `CONTRIBUTING.md` --- CONTRIBUTING.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fc5122a5c7..2644e0f06fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Refer to our guidelines on [pull requests](#pull-requests) and [issues](#issues) ## Contacting maintainers You may reach out to Intel project maintainers privately at onedal.maintainers@intel.com. -[Codeowners](https://github.com/oneapi-src/oneDAL/blob/main/.github/CODEOWNERS) configuration defines specific maintainers for corresponding code sections, however it's currently limited to Intel members. With further migration to UXL we will be changing this, but here are non-Intel contacts: +[Codeowners](https://github.com/oneapi-src/oneDAL/blob/main/.github/CODEOWNERS) configuration defines specific maintainers for corresponding code sections, however it's currently limited to Intel members. With further migration to UXL we will be changing this, but here are non-Intel contacts: For ARM specifics you may contact: [@rakshithgb-fujitsu](https://github.com/rakshithgb-fujitsu/) @@ -65,6 +65,20 @@ clang-format style=file Refer to [ClangFormat documentation](https://clang.llvm.org/docs/ClangFormat.html) for more information. +### editorconfig-checker + +We also recommend using [editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker) to ensure your code adheres to the project's coding style. EditorConfig-Checker is a command-line tool that checks your code against the rules defined in the [.editorconfig](https://github.com/oneapi-src/oneDAL/blob/main/.editorconfig) file. + +To use it, follow these steps: + +1. Install the tool by following the instructions in the [official documentation](https://github.com/editorconfig-checker/editorconfig-checker#installation). +2. Navigate to the root directory of your project. +3. Run the following command to check your code: + +``` +editorconfig-checker +``` + ### Coding Guidelines For your convenience we also added [coding guidelines](http://oneapi-src.github.io/oneDAL/contribution/coding_guide.html) with examples and detailed descriptions of the coding style oneDAL follows. We encourage you to consult them when writing your code. From fe85bbea12c062d53bc270240a677726d440b4c8 Mon Sep 17 00:00:00 2001 From: homksei Date: Thu, 25 Jul 2024 11:41:48 +0200 Subject: [PATCH 3/4] chore(workflows): update `renovate.json` --- .github/renovate.json | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index beea31e9802..97a883c7ef2 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -10,15 +10,24 @@ }, "packageRules": [ { - "groupName": "Doc packages", - "matchUpdateTypes": ["patch", "minor"], - "schedule": ["before 2am on the first day of the month"], - "matchFileNames": ["docs/requirements.txt"] + "groupName": "Doc packages", + "matchUpdateTypes": ["patch", "minor"], + "schedule": ["before 2am on the first day of the month"], + "matchFileNames": ["docs/requirements.txt"] }, { - "groupName": "Dockerfile", - "schedule": ["before 2am on the first day of the month"], - "matchFileNames": ["**/*.Dockerfile"] + "groupName": "Dockerfile", + "schedule": ["before 2am on the first day of the month"], + "matchFileNames": ["**/*.Dockerfile"] + } + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": ["^\\.ci\\/env\\/editorconfig-checker\\.sh$"], + "matchStrings": ["VERSION=(?v\\d+\\.\\d+\\.\\d+)"], + "depNameTemplate": "editorconfig-checker/editorconfig-checker", + "datasourceTemplate": "github-releases" } ] } From 4d8f74d44cd4cc62641ac178c022e6cf3fe9b360 Mon Sep 17 00:00:00 2001 From: homksei Date: Thu, 1 Aug 2024 10:20:48 +0200 Subject: [PATCH 4/4] chore(workflows): `FormattersChecks` -> `FormatterChecks` --- .ci/pipeline/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/pipeline/ci.yml b/.ci/pipeline/ci.yml index bf957f2918b..e2fd4d64d36 100755 --- a/.ci/pipeline/ci.yml +++ b/.ci/pipeline/ci.yml @@ -30,7 +30,7 @@ variables: SYSROOT_OS: 'jammy' jobs: -- job: 'FormattersChecks' +- job: 'FormatterChecks' pool: vmImage: '$(VM_IMAGE)' steps: