Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 71 additions & 46 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
inherit_from: .rubocop_todo.yml

inherit_mode:
merge:
- Exclude
- Include

inherit_gem:
rubocop-gusto:
- config/default.yml

plugins:
- rubocop-gusto

# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
Expand All @@ -11,67 +25,85 @@
AllCops:
NewCops: enable
Exclude:
- bin/**/*
- vendor/bundle/**/**
- tmp/**/**
- target/**/**
TargetRubyVersion: 3.3

Metrics/ParameterLists:
Gemspec/DevelopmentDependencies:
Enabled: true
EnforcedStyle: gemspec

Gemspec/RequireMFA:
Enabled: false

# This cop is annoying with typed configuration
Style/TrivialAccessors:
# This leads to code that is not very readable at times (very long lines)
Layout/ArgumentAlignment:
Enabled: false

# This rubocop is annoying when we use interfaces a lot
Lint/UnusedMethodArgument:
# This leads to code that is not very readable at times (very long lines)
Layout/FirstArgumentIndentation:
Enabled: false

Gemspec/RequireMFA:
# Leaving length metrics to human judgment for now
Layout/LineLength:
Enabled: false

# This leads to code that is not very readable at times (very long lines)
Layout/MultilineMethodCallIndentation:
Enabled: false

Lint/DuplicateBranch:
Enabled: false

# If is sometimes easier to think about than unless sometimes
Style/NegatedIf:
# This rubocop is annoying when we use interfaces a lot
Lint/UnusedMethodArgument:
Enabled: false

# It's nice to be able to read the condition first before reading the code within the condition
Style/GuardClause:
# Leaving length metrics to human judgment for now
Metrics/AbcSize:
Enabled: false

#
# Leaving length metrics to human judgment for now
#
Metrics/ModuleLength:
Metrics/BlockLength:
Enabled: false

Layout/LineLength:
# Leaving length metrics to human judgment for now
Metrics/ClassLength:
Enabled: false

Metrics/BlockLength:
# This doesn't feel useful
Metrics/CyclomaticComplexity:
Enabled: false

# Leaving length metrics to human judgment for now
Metrics/MethodLength:
Enabled: false

Metrics/AbcSize:
# Leaving length metrics to human judgment for now
Metrics/ModuleLength:
Enabled: false

Metrics/ClassLength:
Metrics/ParameterLists:
Enabled: false

# This doesn't feel useful
Metrics/CyclomaticComplexity:
Metrics/PerceivedComplexity:
Enabled: false

# This doesn't feel useful
Metrics/PerceivedComplexity:
# Sometimes we like methods like `get_packages`
Naming/AccessorMethodName:
Enabled: false

# It's nice to be able to read the condition first before reading the code within the condition
Style/IfUnlessModifier:
RSpec/NotToNot:
Enabled: true

Style/AccessorGrouping:
Enabled: false

# Blocks across lines are okay sometimes
Style/BlockDelimiters:
Enabled: false

# This leads to code that is not very readable at times (very long lines)
Expand All @@ -86,40 +118,33 @@ Style/Documentation:
Style/EmptyElse:
Enabled: false

# This interacts poorly with typed code
Style/ModuleFunction:
EnforcedStyle: forbidden

# Sometimes we want to more explicitly list out a condition
Style/RedundantCondition:
# It's nice to be able to read the condition first before reading the code within the condition
Style/GuardClause:
Enabled: false

# This leads to code that is not very readable at times (very long lines)
Layout/MultilineMethodCallIndentation:
Style/HashSyntax:
Enabled: false

# Blocks across lines are okay sometimes
Style/BlockDelimiters:
# It's nice to be able to read the condition first before reading the code within the condition
Style/IfUnlessModifier:
Enabled: false

# Sometimes we like methods like `get_packages`
Naming/AccessorMethodName:
Enabled: false
# This interacts poorly with typed code
Style/ModuleFunction:
EnforcedStyle: forbidden

# This leads to code that is not very readable at times (very long lines)
Layout/FirstArgumentIndentation:
# If is sometimes easier to think about than unless sometimes
Style/NegatedIf:
Enabled: false

# This leads to code that is not very readable at times (very long lines)
Layout/ArgumentAlignment:
# Sometimes we want to more explicitly list out a condition
Style/RedundantCondition:
Enabled: false

Style/AccessorGrouping:
Enabled: false
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/HashSyntax:
# This cop is annoying with typed configuration
Style/TrivialAccessors:
Enabled: false

Gemspec/DevelopmentDependencies:
Enabled: true
EnforcedStyle: gemspec
98 changes: 98 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2026-11-30 21:03:24 UTC using RuboCop version 1.93.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
Gusto/DescribedClassConstantReference:
Exclude:
- 'spec/lib/code_ownership/cli_spec.rb'

# Offense count: 1
Gusto/NoRescueErrorMessageChecking:
Exclude:
- 'lib/code_ownership.rb'

# Offense count: 12
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/lib/code_ownership/cli_spec.rb'
- 'spec/lib/code_ownership_spec.rb'

# Offense count: 16
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/lib/code_ownership/cli_spec.rb'
- 'spec/lib/code_ownership/private/file_path_finder_spec.rb'
- 'spec/lib/code_ownership_spec.rb'
- 'spec/support/application_fixtures.rb'

# Offense count: 1
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/lib/code_ownership/private/file_path_finder_spec.rb'

# Offense count: 2
RSpec/RemoveConst:
Exclude:
- 'spec/support/application_fixtures.rb'

# Offense count: 2
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/lib/code_ownership_spec.rb'

# Offense count: 1
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
# SupportedInflectors: default, active_support
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/lib/code_ownership/private/permit_pack_owner_top_level_key_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Rake/Desc:
Exclude:
- 'Rakefile'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Sorbet/BlockMethodDefinition:
Exclude:
- 'spec/lib/code_ownership_spec.rb'
- 'spec/support/application_fixtures.rb'

# Offense count: 9
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SuggestedStrictness.
Sorbet/StrictSigil:
Exclude:
- 'ext/code_ownership/extconf.rb'
- 'lib/code_ownership/cli.rb'
- 'rakelib/compile.rake'
- 'rakelib/env.rake'
- 'rakelib/helpers.rake'
- 'rakelib/pkg.rake'
- 'rakelib/spec.rake'
- 'spec/spec_helper.rb'
- 'spec/support/application_fixtures.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, Recursive.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/code_ownership/private/for_file_output_builder.rb'

# Offense count: 2
Style/Send:
Exclude:
- 'spec/support/application_fixtures.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"

gemspec

gem 'rake-compiler', '~> 1.3.0'
gem "rake-compiler", "~> 1.3.0"
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

GEMSPEC = Gem::Specification.load('code_ownership.gemspec')
GEMSPEC = Gem::Specification.load("code_ownership.gemspec")

task build: 'pkg:ruby'
task build: "pkg:ruby"

task default: %w[env:dev compile spec]
task default: %w(env:dev compile spec)
69 changes: 35 additions & 34 deletions code_ownership.gemspec
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
# frozen_string_literal: true

require_relative 'lib/code_ownership/version'
require_relative "lib/code_ownership/version"

Gem::Specification.new do |spec|
spec.name = 'code_ownership'
spec.name = "code_ownership"
spec.version = CodeOwnership::VERSION
spec.authors = ['Gusto Engineers']
spec.email = ['dev@gusto.com']
spec.summary = 'A gem to help engineering teams declare ownership of code'
spec.description = 'A gem to help engineering teams declare ownership of code'
spec.homepage = 'https://github.com/rubyatscale/code_ownership'
spec.license = 'MIT'
spec.authors = ["Gusto Engineers"]
spec.email = ["dev@gusto.com"]
spec.summary = "A gem to help engineering teams declare ownership of code"
spec.description = "A gem to help engineering teams declare ownership of code"
spec.homepage = "https://github.com/rubyatscale/code_ownership"
spec.license = "MIT"

if spec.respond_to?(:metadata)
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/rubyatscale/code_ownership'
spec.metadata['changelog_uri'] = 'https://github.com/rubyatscale/code_ownership/releases'
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
spec.metadata['cargo_crate_name'] = 'code_ownership'
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/rubyatscale/code_ownership"
spec.metadata["changelog_uri"] = "https://github.com/rubyatscale/code_ownership/releases"
spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["cargo_crate_name"] = "code_ownership"
else
raise 'RubyGems 2.0 or newer is required to protect against ' \
'public gem pushes.'
raise "RubyGems 2.0 or newer is required to protect against " \
"public gem pushes."
end

spec.required_ruby_version = Gem::Requirement.new('>= 3.3', '< 4.1.dev')
spec.required_ruby_version = Gem::Requirement.new(">= 3.3", "< 4.1.dev")

# https://guides.rubygems.org/make-your-own-gem/#adding-an-executable
# and
# https://bundler.io/blog/2015/03/20/moving-bins-to-exe.html
spec.executables = ['codeownership']
spec.executables = ["codeownership"]

# Specify which files should be added to the gem when it is released.
spec.files = Dir['{lib,ext}/**/*', 'LICENSE', 'README.md', 'Cargo.*']
spec.files = Dir["{lib,ext}/**/*", "LICENSE", "README.md", "Cargo.*"]
spec.files.reject! { |f| File.directory?(f) }
spec.files.reject! { |f| f =~ /\.(dll|so|dylib|lib|bundle)\Z/ }
spec.require_paths = ['lib']
spec.extensions = ['ext/code_ownership/Cargo.toml']

spec.add_dependency 'code_teams', '~> 1.0'
spec.add_dependency 'packs-specification'
spec.add_dependency 'sorbet-runtime', '>= 0.6.12763'

spec.add_development_dependency 'debug'
spec.add_development_dependency 'packwerk'
spec.add_development_dependency 'railties'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rb_sys', '~> 0.9.63'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'sorbet'
spec.add_development_dependency 'tapioca'
spec.require_paths = ["lib"]
spec.extensions = ["ext/code_ownership/Cargo.toml"]

spec.add_dependency "code_teams", "~> 1.0"
spec.add_dependency "packs-specification"
spec.add_dependency "sorbet-runtime", ">= 0.6.12763"

spec.add_development_dependency "debug"
spec.add_development_dependency "packwerk"
spec.add_development_dependency "railties"
spec.add_development_dependency "rake"
spec.add_development_dependency "rb_sys", "~> 0.9.63"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop"
spec.add_development_dependency "rubocop-gusto"
spec.add_development_dependency "sorbet"
spec.add_development_dependency "tapioca"
end
Loading
Loading