From 7ba5a9efb375f3181946f517873f8c92f91c7ee0 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Tue, 24 Sep 2024 08:57:51 +0200 Subject: [PATCH] Enable coding style check action that uses .editorconfig definitions --- .editorconfig | 28 +++++----------------------- .github/workflows/coding-style.yml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/coding-style.yml diff --git a/.editorconfig b/.editorconfig index f953d4ba6..00e1cea3a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,29 +3,16 @@ # top-most EditorConfig file root = true +# Custom Armbian formatting for bash sources and configuration [*] charset = utf-8 end_of_line = lf + +[*.{sh,conf}] indent_style = tab -indent_size = 8 trim_trailing_whitespace = true insert_final_newline = true - -[*.patch] -trim_trailing_whitespace = false - -[*.md] -indent_style = space -indent_size = 4 -insert_final_newline = false - -[*.json] -indent_style = space -indent_size = 4 - -# Custom Armbian formatting for bash sources and configuration -[*.{sh,inc,conf,eos,wip,tvb,csc}] -indent_size = 4 +indent_size = 8 shell_variant = bash binary_next_line = false switch_case_indent = true @@ -33,11 +20,6 @@ space_redirects = true keep_padding = false function_next_line = false -[*.{yaml,yml}] +[*.json] indent_style = space -indent_size = 2 -insert_final_newline = false - -[*.py] indent_size = 4 -max_line_length = 150 diff --git a/.github/workflows/coding-style.yml b/.github/workflows/coding-style.yml new file mode 100644 index 000000000..59397c470 --- /dev/null +++ b/.github/workflows/coding-style.yml @@ -0,0 +1,18 @@ +name: Coding style check + +on: + pull_request: + types: [opened, reopened, edited, synchronize, review_requested] + +concurrency: + group: coding-style-${{github.event.pull_request.number}} + cancel-in-progress: true + +jobs: + editorconfig: + name: "Coding style check" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker