diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 501ddc49ab..7df77092e6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: - if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt install libyaml-dev - name: Set up Ruby - uses: ruby/setup-ruby@d354de180d0c9e813cfddfcbdc079945d4be589b # v1.275.0 + uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0 with: ruby-version: 3.3 bundler-cache: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4dabb4ed5..3149d6e921 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,7 +46,7 @@ jobs: - if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt install libyaml-dev - name: Set up Ruby - uses: ruby/setup-ruby@d354de180d0c9e813cfddfcbdc079945d4be589b # v1.275.0 + uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # 'bundle install' and cache diff --git a/.herb.yml b/.herb.yml new file mode 100644 index 0000000000..398bee965d --- /dev/null +++ b/.herb.yml @@ -0,0 +1,21 @@ +version: 0.9.0 + +linter: + enabled: true + + rules: + # RDoc templates are not Rails partials — instance variables are the + # standard way to pass data from the generator to templates. + erb-no-instance-variables-in-partials: + enabled: false + + # Template output is generated from trusted RDoc data, not user input. + erb-no-unsafe-script-interpolation: + enabled: false + + # Same: attribute values come from trusted RDoc data. + erb-no-output-in-attribute-position: + enabled: false + +formatter: + enabled: false diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index b31c1e4b7d..9a81b74688 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -173,7 +173,7 @@ def initialize(store, options) ## # Output progress information if debugging is enabled - def debug_msg *msg + def debug_msg(*msg) return unless $DEBUG_RDOC $stderr.puts(*msg) end diff --git a/lib/rdoc/generator/json_index.rb b/lib/rdoc/generator/json_index.rb index 065caa47ea..c61391d630 100644 --- a/lib/rdoc/generator/json_index.rb +++ b/lib/rdoc/generator/json_index.rb @@ -118,7 +118,7 @@ def build_index ## # Output progress information if debugging is enabled - def debug_msg *msg + def debug_msg(*msg) return unless $DEBUG_RDOC $stderr.puts(*msg) end diff --git a/lib/rdoc/generator/template/aliki/_head.rhtml b/lib/rdoc/generator/template/aliki/_head.rhtml index 1733bd0174..d855e49081 100644 --- a/lib/rdoc/generator/template/aliki/_head.rhtml +++ b/lib/rdoc/generator/template/aliki/_head.rhtml @@ -28,7 +28,7 @@ <%- elsif @title %> <%- if @options.main_page and - main_page = @files.find { |f| f.full_name == @options.main_page } then %> + main_page = @files.find { |f| f.full_name == @options.main_page } %> " diff --git a/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml b/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml index 1544b83778..a6086639e6 100644 --- a/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +++ b/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml @@ -1,4 +1,4 @@ -<%- unless klass.extends.empty? then %> +<%- unless klass.extends.empty? %>