From 4e4a12aa1ebb83994b57d3fb8b74448febcb465c Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Sat, 6 Jan 2024 12:53:20 +0200 Subject: [PATCH 1/7] feat: add editorconfig rules for java and yml --- .editorconfig | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ddbad56 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +[*.java] +indent_style = tab +tab_width = 4 +end_of_line = crlf +charset = utf-8 +insert_final_newline = true + +ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_class_count_to_use_import_on_demand = 9999 +ij_java_names_count_to_use_import_on_demand = 9999 + +# 'catch (' instead of 'catch(' and so on... +ij_java_space_before_catch_parentheses = true +ij_java_space_before_for_parentheses = true +ij_java_space_before_if_parentheses = true +ij_java_space_before_switch_parentheses = true +ij_java_space_before_try_parentheses = true +ij_java_space_before_while_parentheses = true + +ij_java_blank_lines_after_imports = 1 # blank line between last import and class definition +ij_java_blank_lines_after_class_header = 1 +ij_java_blank_lines_before_class_end = 1 # blank line before closing } of class +ij_java_blank_lines_around_method = 1 + +ij_java_doc_enable_formatting = true +ij_java_doc_align_param_comments = true +ij_java_doc_align_exception_comments = true +ij_java_doc_keep_empty_lines = true +ij_java_doc_add_p_tag_on_empty_lines = true + +[*.yml] +indent_style = space +indent_size = 2 +charset = utf-8 \ No newline at end of file From 9bf86bab2227b890c624545036e7da65e0381845 Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Sat, 6 Jan 2024 12:53:51 +0200 Subject: [PATCH 2/7] feat: add lint check workflow using super-linter --- .github/workflows/lint.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..48229b5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +--- +name: Lint + +on: + push: null + pull_request: null + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Super-linter + uses: super-linter/super-linter@v5.7.2 # x-release-please-version + env: + DEFAULT_BRANCH: main + EDITORCONFIG_FILE_NAME: .editorconfig + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 36c877e8a82b29740e123dbfba7d74cf5864d079 Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 24 Jun 2024 18:49:49 +0300 Subject: [PATCH 3/7] misc: commit to re-run checks --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index ddbad56..5c260a4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -31,4 +31,4 @@ ij_java_doc_add_p_tag_on_empty_lines = true [*.yml] indent_style = space indent_size = 2 -charset = utf-8 \ No newline at end of file +charset = utf-8 From aefeef9e40456c202246f7dd183e45a8c15dd7dc Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 24 Jun 2024 18:56:24 +0300 Subject: [PATCH 4/7] feat: comment EDITORCONFIG_FILE_NAME --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 48229b5..a733b9d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,6 +28,6 @@ jobs: uses: super-linter/super-linter@v5.7.2 # x-release-please-version env: DEFAULT_BRANCH: main - EDITORCONFIG_FILE_NAME: .editorconfig + #EDITORCONFIG_FILE_NAME: .editorconfig # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 99144e8ea24a3889c2371a17bf3c4f1141ef1d17 Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 24 Jun 2024 19:07:48 +0300 Subject: [PATCH 5/7] feat: check only new code --- .github/workflows/lint.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a733b9d..b3c774a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,7 +27,8 @@ jobs: - name: Super-linter uses: super-linter/super-linter@v5.7.2 # x-release-please-version env: - DEFAULT_BRANCH: main - #EDITORCONFIG_FILE_NAME: .editorconfig # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Will parse the entire repository and find all files to validate across all types. + # NOTE: When set to false, only new or edited files will be parsed for validation. + VALIDATE_ALL_CODEBASE: false \ No newline at end of file From 06df89d23d039b1d2e5e6b418518dc8ef67a6815 Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 24 Jun 2024 19:21:07 +0300 Subject: [PATCH 6/7] feat: set DEFAULT_BRANCH --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b3c774a..16018e5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,4 +31,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Will parse the entire repository and find all files to validate across all types. # NOTE: When set to false, only new or edited files will be parsed for validation. - VALIDATE_ALL_CODEBASE: false \ No newline at end of file + VALIDATE_ALL_CODEBASE: false + # Default repository branch when running on GitHub Actions + DEFAULT_BRANCH: main \ No newline at end of file From 89cf343ad14cce5d656804b558ededb0829b210b Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 24 Jun 2024 19:31:04 +0300 Subject: [PATCH 7/7] feat: set VALIDATE_JAVA --- .github/workflows/lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 16018e5..3a89971 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,6 +31,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Will parse the entire repository and find all files to validate across all types. # NOTE: When set to false, only new or edited files will be parsed for validation. - VALIDATE_ALL_CODEBASE: false + VALIDATE_ALL_CODEBASE: true # Default repository branch when running on GitHub Actions - DEFAULT_BRANCH: main \ No newline at end of file + DEFAULT_BRANCH: main + VALIDATE_JAVA: true \ No newline at end of file