From 13ec8b962e9abad31b2ff9f3200c8d8338d0cb29 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:37:26 +0300 Subject: [PATCH 01/17] initial --- .codeclimate.yml | 16 ---------------- .github/workflows/qlty.yml | 31 +++++++++++++++++++++++++++++++ .rubocop.yml | 9 +++++++++ .travis.yml | 13 ------------- 4 files changed, 40 insertions(+), 29 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .github/workflows/qlty.yml create mode 100644 .rubocop.yml delete mode 100644 .travis.yml diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 173ec5e..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: "2" -prepare: - fetch: - - url: "https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby.yml" - path: ".rubocop.yml" -plugins: - duplication: - enabled: true - config: - languages: - - ruby - rubocop: - enabled: true - channel: rubocop-0-74 -exclude_patterns: - - "bin/" \ No newline at end of file diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml new file mode 100644 index 0000000..0563051 --- /dev/null +++ b/.github/workflows/qlty.yml @@ -0,0 +1,31 @@ +name: Qlty Code Quality + +on: + push: + branches: [ main, master, develop ] + pull_request: + branches: [ main, master, develop ] + +jobs: + qlty: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Install Qlty + run: gem install qlty + + - name: Run Qlty check + run: qlty check + + - name: Run Qlty check with detailed output + if: failure() + run: qlty check --verbose diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..b925559 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,9 @@ +# Import Internetee style guide configuration +# This ensures all repositories use the same code style rules +inherit_from: + - https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby.yml + +# Local overrides - exclude bin directory from analysis +AllCops: + Exclude: + - 'bin/**/*' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fdaf671..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -sudo: false -language: ruby -cache: bundler -rvm: - - 2.4.4 -before_install: gem install bundler -v 2.0.2 -before_script: - - "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter" - - "chmod +x ./cc-test-reporter" - - "./cc-test-reporter before-build" -after_script: - - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT" \ No newline at end of file From 50a142edd7bf6eb25b9d7750e0aa0949e1ff179e Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:46:30 +0300 Subject: [PATCH 02/17] added qlty cli --- .github/workflows/qlty.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 0563051..cec57f9 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -14,18 +14,14 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.2' - bundler-cache: true - - - name: Install Qlty - run: gem install qlty + - name: Download Qlty CLI + run: | + curl -L https://github.com/qlty-ai/qlty/releases/latest/download/qlty-x86_64-unknown-linux-gnu.tar.gz | tar xz + chmod +x qlty - name: Run Qlty check - run: qlty check + run: ./qlty check - name: Run Qlty check with detailed output if: failure() - run: qlty check --verbose + run: ./qlty check --verbose From 55f858b3f03be72e0163a32afb4589031d454988 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:49:47 +0300 Subject: [PATCH 03/17] fixed workflow --- .github/workflows/qlty.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index cec57f9..8fb207c 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -14,14 +14,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Download Qlty CLI + - name: Setup qlty.sh CLI run: | - curl -L https://github.com/qlty-ai/qlty/releases/latest/download/qlty-x86_64-unknown-linux-gnu.tar.gz | tar xz - chmod +x qlty + curl -sSL https://qlty.sh/install.sh | bash - name: Run Qlty check - run: ./qlty check + run: qlty check - name: Run Qlty check with detailed output if: failure() - run: ./qlty check --verbose + run: qlty check --verbose From af61e81043cf4f3f282e7b1cd2345fec25f47275 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:53:00 +0300 Subject: [PATCH 04/17] added path and token --- .github/workflows/qlty.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 8fb207c..b38ef3c 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -14,13 +14,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup qlty.sh CLI + - name: Setup qlty.sh run: | curl -sSL https://qlty.sh/install.sh | bash - - name: Run Qlty check - run: qlty check - - - name: Run Qlty check with detailed output - if: failure() - run: qlty check --verbose + - name: Run qlty.sh analysis + env: + QLTY_TOKEN: ${{ secrets.QLTY_TOKEN }} + run: | + export PATH="$HOME/.qlty/bin:$PATH" + qlty check --verbose \ + --repo="${{ github.repository }}" \ + --pr="${{ github.event.number }}" \ + --commit="${{ github.sha }}" \ + --base="${{ github.event.pull_request.base.sha }}" From 4e26fae502f0a42edc2ec1b06ce27737d8338f98 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:55:51 +0300 Subject: [PATCH 05/17] changed workflow --- .github/workflows/qlty.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index b38ef3c..a7cf583 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -19,12 +19,6 @@ jobs: curl -sSL https://qlty.sh/install.sh | bash - name: Run qlty.sh analysis - env: - QLTY_TOKEN: ${{ secrets.QLTY_TOKEN }} run: | export PATH="$HOME/.qlty/bin:$PATH" - qlty check --verbose \ - --repo="${{ github.repository }}" \ - --pr="${{ github.event.number }}" \ - --commit="${{ github.sha }}" \ - --base="${{ github.event.pull_request.base.sha }}" + qlty check --verbose From 822d6e6b3a9746d457c0ccad594ad7e0b9b013eb Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 16:57:38 +0300 Subject: [PATCH 06/17] added repo path --- .github/workflows/qlty.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index a7cf583..2c05476 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -18,6 +18,11 @@ jobs: run: | curl -sSL https://qlty.sh/install.sh | bash + - name: Initialize qlty.sh + run: | + export PATH="$HOME/.qlty/bin:$PATH" + qlty init + - name: Run qlty.sh analysis run: | export PATH="$HOME/.qlty/bin:$PATH" From 5a64cbbf8eb4a45094fab79ae789a0ff7e44f3a8 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 17:03:09 +0300 Subject: [PATCH 07/17] fix for check call --- .github/workflows/qlty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 2c05476..e763b5b 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -26,4 +26,4 @@ jobs: - name: Run qlty.sh analysis run: | export PATH="$HOME/.qlty/bin:$PATH" - qlty check --verbose + qlty check --ci --verbose From c8c8a1db3d94c3827858e8a0e56dfb0cec8643ba Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 17:05:02 +0300 Subject: [PATCH 08/17] fix for init step --- .github/workflows/qlty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index e763b5b..244b9a5 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -21,7 +21,7 @@ jobs: - name: Initialize qlty.sh run: | export PATH="$HOME/.qlty/bin:$PATH" - qlty init + qlty init --ci - name: Run qlty.sh analysis run: | From 8a070f87040fa7870dd522db97dfbead5721d635 Mon Sep 17 00:00:00 2001 From: mmeest Date: Mon, 11 Aug 2025 17:08:44 +0300 Subject: [PATCH 09/17] init fix --- .github/workflows/qlty.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 244b9a5..0e0333a 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -19,9 +19,11 @@ jobs: curl -sSL https://qlty.sh/install.sh | bash - name: Initialize qlty.sh + env: + TERM: dumb run: | export PATH="$HOME/.qlty/bin:$PATH" - qlty init --ci + qlty init - name: Run qlty.sh analysis run: | From 5f3b25c17ef1f71314c883016b4609335b4a8026 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 09:46:28 +0300 Subject: [PATCH 10/17] removed qlty init --- .github/workflows/qlty.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 0e0333a..1f86e07 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -18,13 +18,6 @@ jobs: run: | curl -sSL https://qlty.sh/install.sh | bash - - name: Initialize qlty.sh - env: - TERM: dumb - run: | - export PATH="$HOME/.qlty/bin:$PATH" - qlty init - - name: Run qlty.sh analysis run: | export PATH="$HOME/.qlty/bin:$PATH" From d276f5a1c82221aafdfcea0985a8224a11fbc648 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 09:48:33 +0300 Subject: [PATCH 11/17] removed --ci flag --- .github/workflows/qlty.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index 1f86e07..a7cf583 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -21,4 +21,4 @@ jobs: - name: Run qlty.sh analysis run: | export PATH="$HOME/.qlty/bin:$PATH" - qlty check --ci --verbose + qlty check --verbose From 77e0cf7dbf3cab1da894e04009b4a7cefa8d47db Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 09:51:00 +0300 Subject: [PATCH 12/17] added initialize block --- .github/workflows/qlty.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index a7cf583..eb9f1d9 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -18,6 +18,14 @@ jobs: run: | curl -sSL https://qlty.sh/install.sh | bash + - name: Initialize qlty.sh + env: + CI: true + TERM: dumb + run: | + export PATH="$HOME/.qlty/bin:$PATH" + qlty init + - name: Run qlty.sh analysis run: | export PATH="$HOME/.qlty/bin:$PATH" From c2046ae26bdd68b24b4bce982c13738cce1de0cd Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 09:53:51 +0300 Subject: [PATCH 13/17] added rubocop workflow --- .github/workflows/qlty.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/qlty.yml b/.github/workflows/qlty.yml index eb9f1d9..cc5ea91 100644 --- a/.github/workflows/qlty.yml +++ b/.github/workflows/qlty.yml @@ -1,4 +1,4 @@ -name: Qlty Code Quality +name: RuboCop Code Quality on: push: @@ -7,26 +7,21 @@ on: branches: [ main, master, develop ] jobs: - qlty: + rubocop: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Setup qlty.sh - run: | - curl -sSL https://qlty.sh/install.sh | bash + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true - - name: Initialize qlty.sh - env: - CI: true - TERM: dumb - run: | - export PATH="$HOME/.qlty/bin:$PATH" - qlty init + - name: Install RuboCop + run: gem install rubocop - - name: Run qlty.sh analysis - run: | - export PATH="$HOME/.qlty/bin:$PATH" - qlty check --verbose + - name: Run RuboCop check + run: rubocop --config .rubocop.yml From 5ff7bd57b567ee9204523dbc84b86fb5af66de7c Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 10:00:00 +0300 Subject: [PATCH 14/17] updated rubocop check --- .rubocop.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index b925559..45a07b5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,3 +7,27 @@ inherit_from: AllCops: Exclude: - 'bin/**/*' + +# Fix deprecated rule names for newer RuboCop versions +Style/MixedRegexpCaptureTypes: + Enabled: false + +Lint/MixedRegexpCaptureTypes: + Enabled: true + +Metrics/LineLength: + Enabled: false + +Layout/LineLength: + Enabled: true + Max: 120 + +Naming/UncommunicativeMethodParamName: + Enabled: false + +Naming/MethodParameterName: + Enabled: true + +# Fix documentation department warning +Style/Documentation: + Enabled: false From f0ac743a910596394dd8fca6f17fa4b8c41ce1b3 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 10:04:59 +0300 Subject: [PATCH 15/17] rewrote rubocop.yml --- .rubocop.yml | 74 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 45a07b5..f334964 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,33 +1,77 @@ -# Import Internetee style guide configuration -# This ensures all repositories use the same code style rules -inherit_from: - - https://raw.githubusercontent.com/internetee/style-guide/master/.rubocop-ruby.yml +# Local RuboCop configuration based on Internetee style guide +# This avoids deprecated rule issues from the remote style guide -# Local overrides - exclude bin directory from analysis AllCops: + NewCops: enable + TargetRubyVersion: 3.2 Exclude: - 'bin/**/*' + - 'vendor/**/*' + - 'node_modules/**/*' + - 'db/schema.rb' + - 'config/initializers/version.rb' -# Fix deprecated rule names for newer RuboCop versions -Style/MixedRegexpCaptureTypes: - Enabled: false +# Layout +Layout/LineLength: + Max: 120 -Lint/MixedRegexpCaptureTypes: +Layout/IndentationWidth: + Width: 2 + +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +Layout/EmptyLinesAroundClassBody: Enabled: true -Metrics/LineLength: +# Lint +Lint/UnusedMethodArgument: Enabled: false -Layout/LineLength: +Lint/MixedRegexpCaptureTypes: Enabled: true - Max: 120 -Naming/UncommunicativeMethodParamName: - Enabled: false +# Metrics +Metrics/AbcSize: + Max: 20 + +Metrics/MethodLength: + Max: 20 + +Metrics/ClassLength: + Max: 150 +Metrics/ModuleLength: + Max: 150 + +Metrics/BlockLength: + Max: 30 + Exclude: + - 'spec/**/*' + - 'test/**/*' + +# Naming Naming/MethodParameterName: Enabled: true -# Fix documentation department warning +# Style Style/Documentation: Enabled: false + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/StringLiterals: + EnforcedStyle: single_quotes + +Style/IfUnlessModifier: + Enabled: false + +Style/GuardClause: + Enabled: false + +Style/ReturnNil: + Enabled: true + +Style/Alias: + EnforcedStyle: prefer_alias_method From a9bf8c7d67138252e0778fbcd63ef14e11dfc9b3 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 10:17:00 +0300 Subject: [PATCH 16/17] rubocop update --- .rubocop.yml | 86 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f334964..987b6ce 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,5 @@ # Local RuboCop configuration based on Internetee style guide -# This avoids deprecated rule issues from the remote style guide +# This matches the exact rules from the Internetee style guide AllCops: NewCops: enable @@ -11,6 +11,41 @@ AllCops: - 'db/schema.rb' - 'config/initializers/version.rb' +# Style +Style/Alias: + EnforcedStyle: prefer_alias_method + +Style/FrozenStringLiteralComment: + Enabled: false + +Style/ReturnNil: + Enabled: true + +Style/TrailingCommaInArrayLiteral: + EnforcedStyleForMultiline: comma + +Style/TrailingCommaInHashLiteral: + EnforcedStyleForMultiline: comma + +Style/Lambda: + Enabled: false + +Style/RedundantRegexpEscape: + Enabled: false + +Style/MixedRegexpCaptureTypes: + Enabled: false + +Style/KeywordParametersOrder: + Enabled: false + +Style/StringLiterals: + EnforcedStyle: single_quotes + +# Documentation +Style/Documentation: + Enabled: false + # Layout Layout/LineLength: Max: 120 @@ -18,22 +53,15 @@ Layout/LineLength: Layout/IndentationWidth: Width: 2 -Layout/EmptyLinesAroundMethodBody: - Enabled: true - -Layout/EmptyLinesAroundClassBody: - Enabled: true - -# Lint -Lint/UnusedMethodArgument: +# Metrics +Metrics/PerceivedComplexity: Enabled: false -Lint/MixedRegexpCaptureTypes: - Enabled: true +Metrics/CyclomaticComplexity: + Enabled: false -# Metrics Metrics/AbcSize: - Max: 20 + Enabled: false Metrics/MethodLength: Max: 20 @@ -51,27 +79,15 @@ Metrics/BlockLength: - 'test/**/*' # Naming -Naming/MethodParameterName: - Enabled: true +Naming/UncommunicativeMethodParamName: + AllowedNames: + - x + - y + - ph + - pw + - ip + - id -# Style -Style/Documentation: - Enabled: false - -Style/FrozenStringLiteralComment: - Enabled: false - -Style/StringLiterals: - EnforcedStyle: single_quotes - -Style/IfUnlessModifier: - Enabled: false - -Style/GuardClause: +# Lint +Lint/UnusedMethodArgument: Enabled: false - -Style/ReturnNil: - Enabled: true - -Style/Alias: - EnforcedStyle: prefer_alias_method From e43277600286ab6721e71aa100c6590eb059ad97 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 12 Aug 2025 10:22:01 +0300 Subject: [PATCH 17/17] update rubocop --- .rubocop.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 987b6ce..0909022 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -33,9 +33,6 @@ Style/Lambda: Style/RedundantRegexpEscape: Enabled: false -Style/MixedRegexpCaptureTypes: - Enabled: false - Style/KeywordParametersOrder: Enabled: false @@ -78,8 +75,8 @@ Metrics/BlockLength: - 'spec/**/*' - 'test/**/*' -# Naming -Naming/UncommunicativeMethodParamName: +# Naming - using new rule name +Naming/MethodParameterName: AllowedNames: - x - y @@ -91,3 +88,7 @@ Naming/UncommunicativeMethodParamName: # Lint Lint/UnusedMethodArgument: Enabled: false + +# Fix deprecated rule - moved from Style to Lint +Lint/MixedRegexpCaptureTypes: + Enabled: false