Skip to content

Commit

Permalink
Merge branch 'master' into refactor/switch-statement
Browse files Browse the repository at this point in the history
  • Loading branch information
p8 authored Dec 28, 2024
2 parents 2960f64 + dd3b36e commit 6db1f5c
Show file tree
Hide file tree
Showing 112 changed files with 6,168 additions and 1,443 deletions.
6 changes: 2 additions & 4 deletions .document
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
History.txt
LICENSE.txt
README.txt
RI.txt
*.md
*.rdoc
lib
doc
12 changes: 12 additions & 0 deletions .generated_files_rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This rubocop configuration is ONLY for the generated files (listed in Rakefile). It is not meant to be used for RDoc's
# source code.
# The purpose of this file is to ensure the generated files don't have trailing whitespace or empty lines, which could
# be a problem for ruby/ruby's CI
AllCops:
TargetRubyVersion: 3.3
DisabledByDefault: true

Layout/TrailingWhitespace:
Enabled: true
Layout/TrailingEmptyLines:
Enabled: true
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# release.yml

changelog:
categories:
- title: ✨ Enhancements
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- title: 📚 Documentation
labels:
- documentation
- title: 🛠 Other Changes
labels:
- "*"
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@5daca165445f0ae10478593083f72ca2625e241d # v1.169.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5
- name: Build with RDoc
# Outputs to the './_site' directory by default
run: bundle exec rake rdoc
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint

on: [push, pull_request]

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
lint:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v3.3.0
# libyaml-dev is needed for psych, see https://github.com/ruby/setup-ruby/issues/409
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install libyaml-dev
- name: Set up Ruby
uses: ruby/setup-ruby@master
with:
ruby-version: 3.3
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop
- name: Sanity check for the format_generated_files task
run: bundle exec rake generate format_generated_files

46 changes: 46 additions & 0 deletions .github/workflows/push_gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish gem to rubygems.org

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
push:
if: github.repository == 'ruby/rdoc'
runs-on: ubuntu-latest

environment:
name: rubygems.org
url: https://rubygems.org/gems/rdoc

permissions:
contents: write
id-token: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Set up Ruby
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
with:
bundler-cache: true
ruby-version: ruby

- name: Publish to RubyGems
uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1

- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/ruby-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ruby-core

on:
pull_request:

push:
branches:
- master

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
ruby_core:
name: RDoc under a ruby-core setup
runs-on: ubuntu-20.04
strategy:
fail-fast: false
timeout-minutes: 30
steps:
- name: Set up latest ruby head
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf # v1.204.0
with:
ruby-version: head
bundler: none
- name: Save latest buildable revision to environment
run: echo "REF=$(ruby -v | cut -d')' -f1 | cut -d' ' -f5)" >> $GITHUB_ENV
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
repository: ruby/ruby
path: ruby/ruby
fetch-depth: 10
- name: Checkout the latest buildable revision
run: git switch -c ${{ env.REF }}
working-directory: ruby/ruby
- name: Install libraries
run: |
set -x
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby
- name: Build Ruby
run: |
autoconf
./configure -C --disable-install-doc
make -j2
working-directory: ruby/ruby
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.1.0
with:
path: ruby/rdoc
- name: Sync tools
run: |
ruby tool/sync_default_gems.rb rdoc
working-directory: ruby/ruby
- name: Test RDoc
run: make -j2 -s test-all TESTS="rdoc --no-retry"
working-directory: ruby/ruby
19 changes: 10 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ permissions: # added using https://github.com/step-security/secure-workflows
jobs:
ruby-versions:
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
with:
# 2.7 breaks `test_parse_statements_nodoc_identifier_alias_method`
min_version: 3.0
engine: cruby-truffleruby

test:
needs: ruby-versions
Expand All @@ -21,10 +25,6 @@ jobs:
ruby: truffleruby
- os: windows-latest
ruby: truffleruby-head
- os: windows-latest
ruby: jruby
- os: windows-latest
ruby: jruby-head
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4 # v3.3.0
Expand All @@ -36,15 +36,16 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # 'bundle install' and cache
# Avoid issues on these platforms
- if: ${{ matrix.ruby == '2.6' }}
run: gem update --system
- name: Run test
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
continue-on-error: ${{ startsWith(matrix.ruby, 'truffle') }}
- name: Run test with Prism parser
run: bundle exec rake
env:
RUBYOPT: --enable-frozen_string_literal
RDOC_USE_PRISM_PARSER: true
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rdoc
- if: ${{ matrix.ruby == 'head' && startsWith(matrix.os, 'ubuntu') }}
run: bundle exec rake rubocop
run: bundle exec rake install
9 changes: 9 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exclude:
- lib/rdoc/rd/block_parser.ry
- lib/rdoc/rd/inline_parser.ry
- lib/rdoc/markdown.kpeg
- lib/rdoc/markdown/literals.kpeg
op_dir: _site # for GitHub Pages and should match the config of RDoc task in Rakefile
title: rdoc Documentation
main_page: README.rdoc
warn_missing_rdoc_ref: true
18 changes: 15 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
DisabledByDefault: true
Exclude:
- rdoc.gemspec
SuggestExtensions: false

Layout/TrailingWhitespace:
Enabled: true

Layout/TrailingEmptyLines:
Enabled: true

Layout/SpaceAroundKeyword:
Enabled: true

Layout/SpaceBeforeComma:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Lint/UnreachableCode:
Enabled: true
2 changes: 1 addition & 1 deletion CONTRIBUTING.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If the tests don't pass on the first run check the {GitHub Actions page}[https:/
You can now use `rake` and `autotest` to run the tests.

Note: the `rake` command must be used first before running any tests, because
its used to generate various parsers implemented in RDoc. Also `rake clean` is
it's used to generate various parsers implemented in RDoc. Also `rake clean` is
helpful to delete these generated files.

== Glossary
Expand Down
2 changes: 2 additions & 0 deletions ExampleMarkdown.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Example Markdown

This document contains example output to show RDoc styling. This file was
created from a Markdown file.

Expand Down
2 changes: 2 additions & 0 deletions ExampleRDoc.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
= Example \RDoc

This document contains example output to show RDoc styling. This file was
created from a RDoc Markup file.

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ group :development do
gem 'test-unit-ruby-core'
gem 'rubocop', '>= 1.31.0'
gem 'gettext'
gem 'prism', '>= 0.30.0'
end
Loading

0 comments on commit 6db1f5c

Please sign in to comment.