Skip to content

Commit

Permalink
Remove unused documentation utilities
Browse files Browse the repository at this point in the history
- We don't need the RDoc declaration and tasks anymore
- We don't need the check_docs.rb file anymore
- We also need to update CI configs to account for the above changes
  • Loading branch information
st0012 committed Sep 16, 2024
1 parent df7fc62 commit d1d8037
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 163 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
with:
bundler-cache: true

- name: Check if documentation is up to date
run: bundle exec rake ruby_lsp:check_docs

- name: Typecheck
run: bundle exec srb tc

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ group :development do
gem "mocha", "~> 2.3"
gem "psych", "~> 5.1", require: false
gem "rake", "~> 13.2"
gem "rdoc", require: false, github: "Shopify/rdoc", branch: "create_snapper_generator"
gem "rubocop-md", "~> 1.2.0", require: false
gem "rubocop-minitest", "~> 0.35.0", require: false
gem "rubocop-rake", "~> 0.6.0", require: false
Expand Down
11 changes: 2 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: https://github.com/Shopify/rdoc.git
revision: 92a6b4fcf8b72dd6776c9aa6714abe6f90d4a99e
branch: create_snapper_generator
specs:
rdoc (6.6.3.1)
psych (>= 4.0.0)

PATH
remote: .
specs:
Expand Down Expand Up @@ -58,6 +50,8 @@ GEM
sorbet-runtime (>= 0.5.9204)
rbs (3.5.3)
logger
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
Expand Down Expand Up @@ -138,7 +132,6 @@ DEPENDENCIES
mocha (~> 2.3)
psych (~> 5.1)
rake (~> 13.2)
rdoc!
rubocop (~> 1.65)
rubocop-md (~> 1.2.0)
rubocop-minitest (~> 0.35.0)
Expand Down
15 changes: 0 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

require "bundler/gem_tasks"
require "rake/testtask"
require "rdoc/task"
require "ruby_lsp/check_docs"

Rake::TestTask.new(:test) do |t|
t.libs << "test"
Expand All @@ -19,21 +17,8 @@ namespace :test do
end
end

RDoc::Task.new do |rdoc|
rdoc.main = "README.md"
rdoc.title = "Ruby LSP documentation"
rdoc.rdoc_files.include("*.md", "lib/**/*.rb")
rdoc.rdoc_dir = "docs"
rdoc.markup = "markdown"
rdoc.generator = "snapper"
rdoc.options.push("--copy-files", "misc")
rdoc.options.push("--copy-files", "LICENSE.txt")
end

require "rubocop/rake_task"

RuboCop::RakeTask.new

RubyLsp::CheckDocs.new(FileList["#{__dir__}/lib/ruby_lsp/**/*.rb"], FileList["#{__dir__}/misc/**/*.gif"])

task default: ["test:indexer", :test]
5 changes: 0 additions & 5 deletions dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ up:
- vscode

commands:
docs:
run: bundle exec rake rdoc
subcommands:
check:
run: bundle exec rake ruby_lsp:check_docs
server: exe/ruby-lsp
style: bin/rubocop
typecheck:
Expand Down
130 changes: 0 additions & 130 deletions lib/ruby_lsp/check_docs.rb

This file was deleted.

3 changes: 3 additions & 0 deletions rakelib/index.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

require "sorbet-runtime"
require "ruby_indexer/ruby_indexer"

# Based on https://github.com/ruby/prism/blob/main/rakelib/lex.rake

module GemIndexing
Expand Down
7 changes: 7 additions & 0 deletions test/setup_bundler_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,15 @@ def run_script(path = Dir.pwd, expected_path: nil, **options)
end

def stub_bundle_with_env(env, command = "(bundle check || bundle install) 1>&2")
puts "????????????"
Object.any_instance.expects(:system).with do |actual_env, actual_command|
$stderr.puts "!!!!!!!!!!!!!!!!"
actual_env.delete_if { |k, _v| k.start_with?("BUNDLE_PKGS") }
puts "================"
puts env
puts "================"
puts actual_env
puts "================"
actual_env.all? { |k, v| env[k] == v } && actual_command == command
end.returns(true)
end
Expand Down

0 comments on commit d1d8037

Please sign in to comment.