Skip to content

Commit

Permalink
Removed YARD build option
Browse files Browse the repository at this point in the history
Upon discovering a performance issue with YARD, due to using `OpenStruct`, and seeing this link:lsegal/yard#1525 closed, I've opted to no longer support this gem.

Milestone: major
  • Loading branch information
bkuhlmann committed Jan 6, 2024
1 parent e097ae4 commit baa0359
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 167 deletions.
22 changes: 0 additions & 22 deletions lib/rubysmith/cli/actions/yard.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/rubysmith/cli/commands/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class Build < Sod::Command
on Actions::Setup
on Actions::SimpleCov
on Actions::Versions
on Actions::Yard
on Actions::Zeitwerk

def initialize(builders: BUILDERS, **)
Expand Down
1 change: 0 additions & 1 deletion lib/rubysmith/configuration/contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module Configuration
required(:build_setup).filled :bool
required(:build_simple_cov).filled :bool
required(:build_versions).filled :bool
required(:build_yard).filled :bool
required(:build_zeitwerk).filled :bool
optional(:citation_affiliation).filled :string
optional(:citation_message).filled :string
Expand Down
1 change: 0 additions & 1 deletion lib/rubysmith/configuration/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ build:
setup: true
simple_cov: true
versions: true
yard: false
zeitwerk: true
citation:
message: Please use the following metadata when citing this project in your work.
Expand Down
1 change: 0 additions & 1 deletion lib/rubysmith/configuration/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module Configuration
:build_setup,
:build_simple_cov,
:build_versions,
:build_yard,
:build_zeitwerk,
:citation_affiliation,
:citation_message,
Expand Down
6 changes: 0 additions & 6 deletions lib/rubysmith/templates/%project_name%/.gitignore.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
.bundle
<% if configuration.build_yard %>
.yardoc
<% end %>
<% if configuration.build_yard %>
doc/yard
<% end %>
tmp
6 changes: 0 additions & 6 deletions lib/rubysmith/templates/%project_name%/Gemfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@ group :quality do
end

group :development do
<% if configuration.build_yard && configuration.ascii_doc? %>
gem "asciidoctor", "~> 2.0"
<% end %>
<% if configuration.build_rake %>
gem "rake", "~> 13.1"
<% end %>
<% if configuration.markdown? %>
gem "tocer", "~> 17.0"
<% end %>
<% if configuration.build_yard %>
gem "yard", "~> 0.9"
<% end %>
end

group :test do
Expand Down
9 changes: 0 additions & 9 deletions lib/rubysmith/templates/%project_name%/Rakefile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ require "bundler/setup"
<% if configuration.build_caliber %>
require "rubocop/rake_task"
<% end %>
<% if configuration.build_yard %>
require "yard"
<% end %>
<% if configuration.build_git && configuration.build_git_lint %>
Git::Lint::Rake::Register.call
Expand All @@ -29,12 +26,6 @@ require "bundler/setup"
RuboCop::RakeTask.new
<% end %>

<% if configuration.build_yard %>
YARD::Rake::YardocTask.new do |task|
task.options = ["--title", "<%= configuration.project_label %>", "--output-dir", "doc/yard"]
end
<% end %>

desc "Run code quality checks"
task quality: %i[<% if configuration.build_git && configuration.build_git_lint %>git_lint<% end %> <% if configuration.build_reek %>reek<% end %> <% if configuration.build_caliber %>rubocop<% end %>]

Expand Down
49 changes: 0 additions & 49 deletions spec/lib/rubysmith/builders/bundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,52 +239,6 @@
end
end

context "with YARD only" do
let(:test_configuration) { configuration.minimize.merge build_yard: true }

let :proof do
<<~CONTENT
ruby file: ".ruby-version"
source "https://rubygems.org"
group :development do
gem "asciidoctor", "~> 2.0"
gem "yard", "~> 0.9"
end
CONTENT
end

it "builds Gemfile" do
builder.call
expect(gemfile_path.read).to eq(proof)
end
end

context "with YARD only using Markdown" do
let :test_configuration do
configuration.minimize.merge build_yard: true, documentation_format: "md"
end

let :proof do
<<~CONTENT
ruby file: ".ruby-version"
source "https://rubygems.org"
group :development do
gem "tocer", "~> 17.0"
gem "yard", "~> 0.9"
end
CONTENT
end

it "builds Gemfile" do
builder.call
expect(gemfile_path.read).to eq(proof)
end
end

context "with Zeitwerk only" do
let(:test_configuration) { configuration.minimize.merge build_zeitwerk: true }

Expand Down Expand Up @@ -345,9 +299,7 @@
end
group :development do
gem "asciidoctor", "~> 2.0"
gem "rake", "~> 13.1"
gem "yard", "~> 0.9"
end
group :test do
Expand Down Expand Up @@ -390,7 +342,6 @@
group :development do
gem "rake", "~> 13.1"
gem "tocer", "~> 17.0"
gem "yard", "~> 0.9"
end
group :test do
Expand Down
17 changes: 0 additions & 17 deletions spec/lib/rubysmith/builders/git/ignore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
end
end

context "with YARD only" do
let(:test_configuration) { configuration.minimize.merge build_git: true, build_yard: true }

it "doesn't build ignore file" do
builder.call

expect(ignore_path.read).to eq(<<~CONTENT)
.bundle
.yardoc
doc/yard
tmp
CONTENT
end
end

context "with maximum options" do
let(:test_configuration) { configuration.maximize }

Expand All @@ -46,8 +31,6 @@

expect(ignore_path.read).to eq(<<~CONTENT)
.bundle
.yardoc
doc/yard
tmp
CONTENT
end
Expand Down
27 changes: 0 additions & 27 deletions spec/lib/rubysmith/builders/rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,6 @@
end
end

context "when enabled with only YARD" do
let :test_configuration do
configuration.minimize.merge build_rake: true, build_yard: true
end

it "builds Rakefile" do
expect(rakefile_path.read).to eq(<<~CONTENT)
require "bundler/setup"
require "yard"
YARD::Rake::YardocTask.new do |task|
task.options = ["--title", "Test", "--output-dir", "doc/yard"]
end
desc "Run code quality checks"
task quality: %i[]
task default: %i[quality]
CONTENT
end
end

context "when enabled with all options" do
let(:test_configuration) { configuration.maximize }

Expand All @@ -149,17 +127,12 @@
require "reek/rake/task"
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "yard"
Git::Lint::Rake::Register.call
Reek::Rake::Task.new
RSpec::Core::RakeTask.new { |task| task.verbose = false }
RuboCop::RakeTask.new
YARD::Rake::YardocTask.new do |task|
task.options = ["--title", "Test", "--output-dir", "doc/yard"]
end
desc "Run code quality checks"
task quality: %i[git_lint reek rubocop]
Expand Down
23 changes: 0 additions & 23 deletions spec/lib/rubysmith/cli/actions/yard_spec.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/support/fixtures/attributes/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
:build_setup:
:build_simple_cov:
:build_versions:
:build_yard:
:build_zeitwerk:
:citation_affiliation:
:citation_message:
Expand Down
1 change: 0 additions & 1 deletion spec/support/fixtures/attributes/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
:build_setup: true
:build_simple_cov: true
:build_versions: true
:build_yard: false
:build_zeitwerk: true
:citation_message: "Please use the following metadata when citing this project in your work."
:documentation_format: "adoc"
Expand Down
1 change: 0 additions & 1 deletion spec/support/fixtures/attributes/maximum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@
:build_setup: true
:build_simple_cov: true
:build_versions: true
:build_yard: true
:build_zeitwerk: true
1 change: 0 additions & 1 deletion spec/support/fixtures/attributes/minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@
:build_setup: false
:build_simple_cov: false
:build_versions: false
:build_yard: false
:build_zeitwerk: false

0 comments on commit baa0359

Please sign in to comment.