From a5e1a1cc1487f3737ac7eb805d45986942090f72 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 11 Apr 2025 20:29:08 +0200 Subject: [PATCH 1/7] Update rubocop config --- .rubocop.yml | 367 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..18c633d --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,367 @@ +require: + - rubocop-disable_syntax + +plugins: + - rubocop-performance + - rubocop-rake + - rubocop-rspec + +AllCops: + TargetRubyVersion: 3.1 + NewCops: enable + +# We use standard as a linter and formatter instead Rubocop. +# Also, we are explicitly disable all rubocop rules what +# already enabled in standard. And standard-performance. + +# Standard rules. Style: + +# Enforced by standard. Disable. +Style/StringLiterals: + Enabled: false + +# Enforced by standard. Disable. +Style/HashSyntax: + Enabled: false + +# Enforced by standard. Disable. +Style/NestedParenthesizedCalls: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantRegexpArgument: + Enabled: false + +# Enforced by standard. Disable. +Style/PercentLiteralDelimiters: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantBegin: + Enabled: false + +# Enforced by standard. Disable. +Style/SuperWithArgsParentheses: + Enabled: false + +# Enforced by standard. Disable. +Style/Encoding: + Enabled: false + +# Enforced by standard. Disable. +Style/NumericLiteralPrefix: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantParentheses: + Enabled: false + +# Enforced by standard. Disable. +Style/EmptyMethod: + Enabled: false + +# Enforced by standard. Disable. +Style/SingleLineMethods: + Enabled: false + +# Enforced by standard. Disable. +Style/SafeNavigation: + Enabled: false + +# Enforced by standard. Disable. +Style/RescueStandardError: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantSelf: + Enabled: false + +# Enforced by standard. Disable. +Style/TernaryParentheses: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantLineContinuation: + Enabled: false + +# Enforced by standard. Disable. +Style/SlicingWithRange: + Enabled: false + +# Enforced by standard. Disable. +Style/MultilineIfModifier: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantCondition: + Enabled: false + +# Enforced by standard. Disable. +Style/RedundantInterpolation: + Enabled: false + +# Enforced by standard. Disable. +Style/OrAssignment: + Enabled: false + +# Enforced by standard. Disable. +Style/ConditionalAssignment: + Enabled: false + +# Enforced by standard. Disable. +Style/ItAssignment: + Enabled: false + +# Enforced by standard. Disable. +Style/EachWithObject: + Enabled: false + +# Enforced by standard. Disable. +Style/GlobalStdStream: + Enabled: false + +# Enforced by standard. Disable. +Style/StringLiteralsInInterpolation: + Enabled: false + +# Disabled as in standard. +Style/HashAsLastArrayItem: + Enabled: false + +# Enforced by standard. Disable. +Style/Alias: + Enabled: false + +# Standard rules. Layout: + +# Enforced by standard. Disable. +Layout/HashAlignment: + Enabled: false + +# Enforced by standard. Disable. +Layout/FirstArrayElementIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/SpaceInsideHashLiteralBraces: + Enabled: false + +# Enforced by standard. Disable. +Layout/SpaceInsideStringInterpolation: + Enabled: false + +# Enforced by standard. Disable. +Layout/DotPosition: + Enabled: false + +# Enforced by standard. Disable. +Layout/ExtraSpacing: + Enabled: false + +# Enforced by standard. Disable. +Layout/ArgumentAlignment: + Enabled: false + +# Enforced by standard. Disable. +Layout/MultilineMethodCallBraceLayout: + Enabled: false + +# Enforced by standard. Disable. +Layout/AccessModifierIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/FirstHashElementIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/IndentationWidth: + Enabled: false + +# Enforced by standard. Disable. +Layout/ElseAlignment: + Enabled: false + +# Enforced by standard. Disable. +Layout/EndAlignment: + Enabled: false + +# Enforced by standard. Disable. +Layout/MultilineHashBraceLayout: + Enabled: false + +# Enforced by standard. Disable. +Layout/EmptyLineBetweenDefs: + Enabled: false + +# Enforced by standard. Disable. +Layout/MultilineArrayBraceLayout: + Enabled: false + +# Enforced by standard. Disable. +Layout/EmptyLineAfterMagicComment: + Enabled: false + +# Enforced by standard. Disable. +Layout/SpaceAroundOperators: + Enabled: false + +# Enforced by standard. Disable. +Layout/ArrayAlignment: + Enabled: false + +# Enforced by standard. Disable. +Layout/AssignmentIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/ClosingParenthesisIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/LineLength: + Enabled: false + +# Enforced by standard. Disable. +Layout/MultilineMethodCallIndentation: + Enabled: false + +# Enforced by standard. Disable. +Layout/CaseIndentation: + Enabled: false + +# Standard rules. Lint: + +# Enforced by standard. Disable. +Lint/ImplicitStringConcatenation: + Enabled: false + +# Enforced by standard. Disable. +Lint/TripleQuotes: + Enabled: false + +# Enforced by standard. Disable. +Lint/IneffectiveAccessModifier: + Enabled: false + +# Enforced by standard. Disable. +Lint/SymbolConversion: + Enabled: false + +# Enforced by rubocop and standard +Lint/CopDirectiveSyntax: + Enabled: true + +# Enforced by standard. Disable. +Lint/DuplicateMethods: + Enabled: false + +# Enforced by standard. Disable. +Lint/ConstantDefinitionInBlock: + Enabled: false + +# Enforced by standard. Disable. +Lint/UselessTimes: + Enabled: false + +# Standard-performance rules. + +# Enforced by standard-performance. Disable. +Performance/Detect: + Enabled: false + +# Enforced by standard-performance. Disable. +Performance/StringIdentifierArgument: + Enabled: false + +# Enforced by standard-performance. Disable. +Performance/RegexpMatch: + Enabled: false + +# Always enable rubocop Security: + +# Enforced by rubocop and standard +Security/JSONLoad: + Enabled: true + +# Our rubocop rules + +# Bundler rules. + +Bundler/OrderedGems: + Enabled: false + +# Gemspec rules + +Gemspec/OrderedDependencies: + Enabled: false + +# Style rules + +# Don't allow %i[foo bar baz] +Style/SymbolArray: + Enabled: true + EnforcedStyle: brackets + +# Don't allow %w[foo bar baz] +Style/WordArray: + Enabled: true + EnforcedStyle: brackets + +# Disable warnings like "Missing top-level documentation comment for" +Style/Documentation: + Enabled: false + +# Disable as in standard. +Style/ArgumentsForwarding: + Enabled: false + +# RSpec rules + +# Prefer eq over be. +RSpec/BeEq: + Enabled: false + +# Prefer eq over eql. +RSpec/BeEql: + Enabled: false + +# We prefer to use `expect` over `allow`. +RSpec/StubbedMock: + Enabled: false + +# We prefer multiple before blocks in tests. +RSpec/ScatteredSetup: + Enabled: false + +# We use `expect` in before hooks. +RSpec/ExpectInHook: + Enabled: false + +# We use item_1, item_2, etc. Disable. +RSpec/IndexedLet: + Enabled: false + +# We don't use named subject's +RSpec/NamedSubject: + Enabled: false + +# Naming rules: + +# Disable anonymous block forwarding. +Naming/BlockForwarding: + Enabled: true + EnforcedStyle: explicit + +# Enable and exclude specific files. +Naming/FileName: + Enabled: true + +# Disabled syntax: + +# Disable shorthand hash syntax like: ({ x:, y: }) +# Disable % style literals +Style/DisableSyntax: + DisableSyntax: + - shorthand_hash_syntax + - percent_literals From 43de73d8144333608a180e70ae7683fc09e23072 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 11 Apr 2025 20:32:11 +0200 Subject: [PATCH 2/7] Add rubocop --- Gemfile | 7 ++++++- Gemfile.lock | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index e92d854..ee1a31e 100644 --- a/Gemfile +++ b/Gemfile @@ -7,5 +7,10 @@ gemspec gem "rake" gem "rspec" -gem "standard" gem "simplecov", require: false +gem "standard", require: false +gem "rubocop", require: false +gem "rubocop-disable_syntax", require: false +gem "rubocop-performance", require: false +gem "rubocop-rake", require: false +gem "rubocop-rspec", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 821aaff..19a1782 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,10 +48,18 @@ GEM rubocop-ast (1.44.0) parser (>= 3.3.7.2) prism (~> 1.4) + rubocop-disable_syntax (0.1.1) + rubocop (>= 1.50) rubocop-performance (1.25.0) lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.5.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) ruby-progressbar (1.13.0) simplecov (0.22.0) docile (~> 1.1) @@ -82,6 +90,11 @@ DEPENDENCIES errbit_plugin! rake rspec + rubocop + rubocop-disable_syntax + rubocop-performance + rubocop-rake + rubocop-rspec simplecov standard From 43a2b608149e6d36d1f32590acccac21db24e537 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 11 Apr 2025 20:39:24 +0200 Subject: [PATCH 3/7] http -> https --- errbit_plugin.gemspec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index 99db404..ffe3abe 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -1,17 +1,16 @@ # frozen_string_literal: true -lib = File.expand_path("../lib", __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "errbit_plugin/version" +require_relative "lib/errbit_plugin/version" Gem::Specification.new do |spec| spec.name = "errbit_plugin" spec.version = ErrbitPlugin::VERSION spec.authors = ["Stephen Crosby"] spec.email = ["stevecrozz@gmail.com"] + spec.description = "Base to create an errbit plugin" spec.summary = "Base to create an errbit plugin" - spec.homepage = "http://github.com/errbit/errbit" + spec.homepage = "https://github.com/errbit/errbit" spec.license = "MIT" spec.files = `git ls-files`.split($/) From 69ba9f902e41a3b8c71a46fc2b9f7786758d6dbf Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 11 Apr 2025 21:16:59 +0200 Subject: [PATCH 4/7] Update --- errbit_plugin.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index ffe3abe..46d1ab4 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -8,10 +8,11 @@ Gem::Specification.new do |spec| spec.authors = ["Stephen Crosby"] spec.email = ["stevecrozz@gmail.com"] - spec.description = "Base to create an errbit plugin" spec.summary = "Base to create an errbit plugin" - spec.homepage = "https://github.com/errbit/errbit" + spec.description = "Base to create an errbit plugin" + spec.homepage = "https://github.com/errbit/errbit_plugin" spec.license = "MIT" + spec.required_ruby_version = ">= 3.1.0" spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } From 3a13a0546ac4ac3636b99f1c2b04fcd4f76d479c Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 15:23:38 +0200 Subject: [PATCH 5/7] Add metadata to gemspec --- errbit_plugin.gemspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index 46d1ab4..e5c834e 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -14,6 +14,9 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.required_ruby_version = ">= 3.1.0" + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.require_paths = ["lib"] From fb3332e62b376936664cbd3aac3a4e4a2485a895 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 16:06:05 +0200 Subject: [PATCH 6/7] Update gemspec --- errbit_plugin.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index e5c834e..9690ad2 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -16,6 +16,8 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage + spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues" + spec.metadata["rubygems_mfa_required"] = "true" spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } From 64cd9e8b625493abb6c0c5e02e650e2f2ba785da Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 16:16:21 +0200 Subject: [PATCH 7/7] Update rubocop-ast gem to 1.44.1 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 19a1782..9875c21 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GEM rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.0) + rubocop-ast (1.44.1) parser (>= 3.3.7.2) prism (~> 1.4) rubocop-disable_syntax (0.1.1)