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
35 changes: 35 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
inherit_from: .rubocop_todo.yml

inherit_mode:
merge:
- Exclude
- Include

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

plugins:
- rubocop-gusto

AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.3
Exclude:
- bin/**/*
- vendor/bundle/**/**

Gemspec/DevelopmentDependencies:
Enabled: true
EnforcedStyle: gemspec

Gemspec/RequireMFA:
Enabled: false

RSpec/NotToNot:
Enabled: true

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
168 changes: 168 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# This configuration was generated by
# `rubocop --auto-gen-config --exclude-limit 10000`
# on 2026-11-30 21:06:59 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: 1
# Configuration parameters: EnforcedStyle, AllowedGems.
# SupportedStyles: Gemfile, gems.rb, gemspec
Gemspec/DevelopmentDependencies:
Exclude:
- 'spec/sample_app1/Gemfile'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Gusto/RegexpBypass:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: RequireParenthesesForMethodChains.
Lint/AmbiguousRange:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/UselessAssignment:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 4
# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/InefficientHashSearch:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 33
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 3
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: SuggestedStrictness.
Sorbet/FalseSigil:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SuggestedStrictness.
Sorbet/StrictSigil:
Exclude:
- 'd3_graph_generator/parse_packwerk_integration.rb'
- 'sorbet/tapioca/require.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
Style/AutoResourceCleanup:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowOnConstant, AllowOnSelfClass.
Style/CaseEquality:
Exclude:
- 'd3_graph_generator/parse_packwerk_integration.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/DigChain:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 1
Style/FileOpen:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'd3_graph_generator/parse_packwerk_integration.rb'
- 'spec/sample_app1/Gemfile'
- 'visualize_packs.gemspec'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 2
# Configuration parameters: AllowedClasses.
Style/OneClassPerFile:
Exclude:
- 'lib/visualize_packs/options.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/ReduceToHash:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Methods.
Style/RedundantArgument:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/RedundantInterpolation:
Exclude:
- 'spec/visualize_packs_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Exclude:
- 'lib/visualize_packs.rb'

# Offense count: 6
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
# AllowedMethods: define_method
Style/SymbolProc:
Exclude:
- 'lib/visualize_packs.rb'
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec

59 changes: 59 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.3)
benchmark (0.5.0)
bigdecimal (4.1.3)
code_teams (1.3.1)
sorbet-runtime
diff-lcs (1.6.2)
erubi (1.13.1)
json (3.2.0)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
logger (1.7.0)
netrc (0.11.0)
packs-specification (0.0.11)
Expand All @@ -22,14 +28,20 @@ GEM
parse_packwerk (0.28.0)
bigdecimal
sorbet-runtime
parser (3.3.14.0)
ast (~> 2.4.1)
racc
prism (1.9.0)
racc (1.8.1)
rainbow (3.1.1)
rbi (0.4.3)
prism (~> 1.0)
rbs (>= 4.0.1)
rbs (4.2.0)
logger
prism (>= 1.6.0)
tsort
regexp_parser (2.13.4)
require-hooks (0.5.1)
rexml (3.4.4)
rspec (3.13.2)
Expand All @@ -45,10 +57,53 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
rubocop (1.93.0)
json (>= 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.11.3, < 3.0)
rubocop-ast (>= 1.54.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.54.0)
ast (~> 2.4)
parser (>= 3.3.7.2)
prism (>= 1.7)
racc
rubocop-gusto (11.12.0)
code_teams
lint_roller
rubocop (>= 1.76)
rubocop-performance
rubocop-rake
rubocop-rspec
rubocop-sorbet (>= 0.13.0)
smart_todo
thor
rubocop-performance (1.27.0)
lint_roller (~> 1.1)
rubocop (>= 1.89.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.11.0)
lint_roller (~> 1.1)
rubocop (~> 1.92)
rubocop-sorbet (0.17.2)
rbi (~> 0.4, >= 0.4.3)
rbs (>= 4.1.1)
spoom (~> 1.8)
ruby-progressbar (1.13.0)
rubydex (0.4.1-aarch64-linux)
rubydex (0.4.1-arm64-darwin)
rubydex (0.4.1-x86_64-darwin)
rubydex (0.4.1-x86_64-linux)
smart_todo (1.11.0)
prism (~> 1.0)
sorbet (0.6.13594)
sorbet-static (= 0.6.13594)
sorbet-runtime (0.6.13594)
Expand Down Expand Up @@ -80,6 +135,9 @@ GEM
tsort
thor (1.5.0)
tsort (0.2.0)
unicode-display_width (3.3.0)
unicode-emoji (~> 4.3)
unicode-emoji (4.3.0)

PLATFORMS
aarch64-linux
Expand All @@ -89,6 +147,7 @@ PLATFORMS
DEPENDENCIES
bundler
rspec (~> 3.12)
rubocop-gusto
sorbet
tapioca
visualize_packs!
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# typed: ignore

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

Expand Down
30 changes: 16 additions & 14 deletions d3_graph_generator/parse_packwerk_integration.rb
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
require 'bundler/inline'
require 'json'
# typed: false

require "bundler/inline"
require "json"

gemfile do
source 'https://rubygems.org'
gem 'parse_packwerk'
gem 'pry'
source "https://rubygems.org"
gem "parse_packwerk"
gem "pry"
end

d3_json = nil
Dir.chdir(ENV['RELATIVE_PATH_TO_REPOSITORY']) do
Dir.chdir(ENV.fetch("RELATIVE_PATH_TO_REPOSITORY", nil)) do
d3_json = {
"nodes" => ParsePackwerk.all.reject {|package| package.name === "."}.map do |package|
"nodes" => ParsePackwerk.all.reject { |package| package.name === "." }.map do |package|
readme_link = package.directory.join("README.md")
readme = readme_link.exist? ? readme_link : nil
{
"id" => package.name,
"group" => package.dependencies.length,
"metadata" => {
"README" => "https://github.com/#{ENV['GITHUB_REPO_SLUG']}/blob/main/#{readme}"
}
"README" => "https://github.com/#{ENV.fetch('GITHUB_REPO_SLUG', nil)}/blob/main/#{readme}",
},
}
end,
"links" => ParsePackwerk.all.reject {|package| package.name === "."}.flat_map do |package|
package.dependencies.reject { |d| d == '.' }.map do |dependency|
"links" => ParsePackwerk.all.reject { |package| package.name === "." }.flat_map do |package|
package.dependencies.reject { |d| d == "." }.map do |dependency|
{
"source" => package.name,
"target" => dependency,
"value" => 1
"value" => 1,
}
end
end
end,
}
end

Pathname('src/utilities/packwerk_graph.json').write(d3_json.to_json)
Pathname("src/utilities/packwerk_graph.json").write(d3_json.to_json)
Loading