From a5e1a1cc1487f3737ac7eb805d45986942090f72 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 11 Apr 2025 20:29:08 +0200 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 05/11] 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 06/11] 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 07/11] 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) From 7178f1ee7c4efd6b24b8af8805b7103fa7d92f9b Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 20:15:06 +0200 Subject: [PATCH 08/11] Cleanup --- errbit_plugin.gemspec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec index 9690ad2..448ce5f 100644 --- a/errbit_plugin.gemspec +++ b/errbit_plugin.gemspec @@ -19,7 +19,14 @@ Gem::Specification.new do |spec| 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) } + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) + spec.files = IO.popen(["git", "ls-files", "-z"], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines("\x0", chomp: true).reject do |f| + (f == gemspec) || + f.start_with?("bin/", "test/", "spec/", "features/", ".git", ".github", "appveyor", "Gemfile") + end + end spec.require_paths = ["lib"] end From 33222698c802b24f3a71b1d88b7df2269686b9cb Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 20:15:23 +0200 Subject: [PATCH 09/11] Bundler 2.6.8 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9875c21..12d58d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,4 +99,4 @@ DEPENDENCIES standard BUNDLED WITH - 2.6.7 + 2.6.8 From 458efaaa53255f666d18c97e64cfc7a6178dfcd4 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 20:16:06 +0200 Subject: [PATCH 10/11] bundle lock --normalize-platforms --- Gemfile.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 12d58d4..14633e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,7 +84,8 @@ GEM unicode-emoji (4.0.4) PLATFORMS - arm64-darwin-24 + arm64-darwin + ruby DEPENDENCIES errbit_plugin! From 0964eaa8f07cf97e70e28896ea6cff692fc41eab Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Sun, 13 Apr 2025 20:16:28 +0200 Subject: [PATCH 11/11] bundle lock --add-checksums --- Gemfile.lock | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index 14633e2..706b25e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,5 +99,41 @@ DEPENDENCIES simplecov standard +CHECKSUMS + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + diff-lcs (1.6.1) sha256=12a5a83f3e37a8e2f4427268e305914d5f1879f22b4e73bb1a09f76a3dd86cd4 + docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e + errbit_plugin (0.7.0) + json (2.10.2) sha256=34e0eada93022b2a0a3345bb0b5efddb6e9ff5be7c48e409cfb54ff8a36a8b06 + language_server-protocol (3.17.0.4) sha256=c484626478664fd13482d8180947c50a8590484b1258b99b7aedb3b69df89669 + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef + parser (3.3.7.4) sha256=2b26282274280e13f891080dc4ef3f65ce658d62e13255b246b28ec6754e98ab + prism (1.4.0) sha256=dc0e3e00e93160213dc2a65519d9002a4a1e7b962db57d444cf1a71565bb703e + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d + regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61 + rspec (3.13.0) sha256=d490914ac1d5a5a64a0e1400c1d54ddd2a501324d703b8cfe83f458337bab993 + rspec-core (3.13.3) sha256=25136507f4f9cf2e8977a2851e64e438b4331646054e345998714108745cdfe4 + rspec-expectations (3.13.3) sha256=0e6b5af59b900147698ea0ff80456c4f2e69cac4394fbd392fbd1ca561f66c58 + rspec-mocks (3.13.2) sha256=2327335def0e1665325a9b617e3af9ae20272741d80ac550336309a7c59abdef + rspec-support (3.13.2) sha256=cea3a2463fd9b84b9dcc9685efd80ea701aa8f7b3decb3b3ce795ed67737dbec + rubocop (1.75.2) sha256=8efde647e278417e8074421b007e0d7d7c591482ef99d980528b18fea015a7c8 + rubocop-ast (1.44.1) sha256=e3cc04203b2ef04f6d6cf5f85fe6d643f442b18cc3b23e3ada0ce5b6521b8e92 + rubocop-disable_syntax (0.1.1) sha256=fba0b24edbd3de049ccaac8473c18fed308b5bd991e389a3368965f6cb88edbb + rubocop-performance (1.25.0) sha256=6f7d03568a770054117a78d0a8e191cefeffb703b382871ca7743831b1a52ec1 + rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d + rubocop-rspec (3.5.0) sha256=710c942fe1af884ba8eea75cbb8bdbb051929a2208880a6fc2e2dce1eed5304c + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5 + simplecov-html (0.13.1) sha256=5dab0b7ee612e60e9887ad57693832fdf4695b4c0c859eaea5f95c18791ef10b + simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428 + standard (1.49.0) sha256=590cd11a2021350812483cb53fc185bd8a92ca215839145d71fdd693750bb470 + standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b + standard-performance (1.8.0) sha256=ed17b7d0e061b2a19a91dd434bef629439e2f32310f22f26acb451addc92b788 + unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1 + unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a + BUNDLED WITH 2.6.8