Verified Commit 4f664bb8 authored by Bob Van Landuyt's avatar Bob Van Landuyt 💬
Browse files

chore: remove rufo

The style is incomatible with `editorconfig` and the `gitlab-styles`
already configured. Let's stick to `gitlab-styles` as that is already
used in many projects.

This also fixes the editorconfig and shfmt failures.
parent 99f800ec
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
# DO NOT MANUALLY EDIT; Run ./scripts/update-asdf-version-variables.sh to update this
variables:
    GL_ASDF_PRE_COMMIT_VERSION: "4.2.0"
    GL_ASDF_RUBY_VERSION: "3.4.3"
    GL_ASDF_SHELLCHECK_VERSION: "0.10.0"
    GL_ASDF_SHFMT_VERSION: "3.11.0"
    GL_ASDF_RUBY_VERSION: "3.4.3"
+6 −46
Original line number Diff line number Diff line
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2025-05-05 11:51:09 UTC using RuboCop version 1.71.1.
# on 2025-05-05 15:54:30 UTC using RuboCop version 1.68.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -48,14 +48,6 @@ Gemspec/RequiredRubyVersion:
  Exclude:
    - 'gitlab-labkit.gemspec'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation
Layout/ArgumentAlignment:
  Exclude:
    - 'spec/labkit/context_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Categories, ExpectedOrder.
@@ -70,16 +62,6 @@ Layout/EmptyLineAfterMagicComment:
  Exclude:
    - 'lib/labkit/logging/json_logger.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
  Exclude:
    - 'spec/labkit/context_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
@@ -88,14 +70,6 @@ Layout/MultilineOperationIndentation:
  Exclude:
    - 'lib/labkit/logging/json_logger.rb'

# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideBlockBraces:
  EnforcedStyle: space

# Offense count: 10
Lint/BinaryOperatorWithIdenticalOperands:
  Exclude:
@@ -170,8 +144,7 @@ Lint/UnexpectedBlockArity:

# Offense count: 41
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
# NotImplementedExceptions: NotImplementedError
# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
  Exclude:
    - 'lib/labkit/correlation/grpc/client_interceptor.rb'
@@ -353,7 +326,7 @@ Rails/NegateInclude:
  Exclude:
    - 'spec/labkit/correlation/grpc/client_interceptor_spec.rb'

# Offense count: 3
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: **/Rakefile, **/*.rake
@@ -396,12 +369,6 @@ Style/FetchEnvVar:
    - 'lib/labkit/tracing.rb'
    - 'spec/helpers/stub_env.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/FileNull:
  Exclude:
    - 'spec/labkit/logging/json_logger_spec.rb'

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
@@ -430,7 +397,7 @@ Style/GuardClause:
  Exclude:
    - 'lib/labkit/logging/json_logger.rb'

# Offense count: 35
# Offense count: 34
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
@@ -486,13 +453,6 @@ Style/QuotedSymbols:
    - 'spec/labkit/tracing/rack_middleware_spec.rb'
    - 'spec/support/tracing/shared_examples.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Methods.
Style/RedundantArgument:
  Exclude:
    - 'Rakefile'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantBegin:
@@ -592,9 +552,9 @@ Style/TrailingCommaInArrayLiteral:
Style/TrailingCommaInHashLiteral:
  Enabled: false

# Offense count: 69
# Offense count: 68
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
  Max: 294
+2 −0
Original line number Diff line number Diff line
ruby 3.4.3
shfmt 3.11.0
shellcheck 0.10.0
+2 −4
Original line number Diff line number Diff line
# LabKit-Ruby 🔬🔬🔬🔬🔬
# LabKit-Ruby 🔬🔬🔬🔬🔬

LabKit-Ruby is minimalist library to provide functionality for Ruby services at GitLab.

@@ -40,8 +40,6 @@ $ # Run tests, linters
$ bundle exec rake verify
```

Note that LabKit-Ruby uses the [`rufo`](https://github.com/ruby-formatter/rufo) for auto-formatting. Please run `bundle exec rake fix` to auto-format your code before pushing.

Please also review the [development section of the LabKit (go) README](https://gitlab.com/gitlab-org/labkit#developing-labkit) for details of the LabKit architectural philosophy.

To work on some of the scripts we use for releasing a new version,
@@ -51,7 +49,7 @@ make sure to add a new `.env.sh`.
cp .env.example.sh .env.sh`
```

Inside `.env.sh`, add a personal acccess token for the `GITLAB_TOKEN`
Inside `.env.sh`, add a personal acccess token for the `CHANGELOG_GITLAB_TOKEN`
environment variable. Next source the file:

```console
+5 −24
Original line number Diff line number Diff line
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rufo"

require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
@@ -11,27 +10,9 @@ RuboCop::RakeTask.new(:rubocop) do |task|
  task.options = %w[--parallel]
end

desc "Alias for `rake rufo:run`"
task :format => ["rufo:run"]

namespace :rufo do
  require "rufo"

  def rufo_command(*switches, rake_args)
    files_or_dirs = rake_args[:files_or_dirs] || "."
    args = switches + files_or_dirs.split(" ")
    Rufo::Command.run(args)
  end

  desc "Format Ruby code in current directory"
  task :run, [:files_or_dirs] do |_task, rake_args|
    rufo_command(rake_args)
  end

  desc "Check that no formatting changes are produced"
  task :check, [:files_or_dirs] do |_task, rake_args|
    rufo_command("--check", rake_args)
  end
desc "update the rubocop todo config"
RuboCop::RakeTask.new("rubocop:config") do |task|
  task.options = %w[--auto-gen-config]
end

desc "Generate test protobuf stubs"
@@ -40,8 +21,8 @@ task :gen_test_proto do
  Rufo::Command.run(["spec/support/grpc_service/test_pb.rb", "spec/support/grpc_service/test_services_pb.rb"])
end

task :fix => %w[rufo:run rubocop:auto_correct]
task :fix => ["rubocop:autocorrect"]

task :verify => %w[spec rufo:check rubocop]
task :verify => %w[spec rubocop]

task :default => %w[verify build]
Loading