Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX-1846: Bump HTMLProofer from v3 to v4 #298

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion .docker/entrypoint/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
require:
- rubocop-rake
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- Rakefile
- _site/**/*
- spec/**/*
- vendor/**/*
TargetRubyVersion: 2.7
TargetRubyVersion: 2.7.6
Layout:
LineLength: 100
IndentationStyle:
Expand Down
6 changes: 4 additions & 2 deletions .docker/entrypoint/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ gem 'kramdown-plantuml', '>= 1.1.12'
gem 'rouge', '~> 3'

group :development, :test do
gem 'awesome_print'
gem 'bundler', '>= 2.3'
gem 'codecov', '>= 0.6'
gem 'diffy', '~> 3'
gem 'html-proofer', '~> 3'
gem 'html-proofer-unrendered-markdown', '>= 0.1'
gem 'html-proofer', '>= 4'
gem 'html-proofer-unrendered-markdown', '>= 0.2'
gem 'its', '>= 0.2'
gem 'rake', '~> 13'
gem 'rspec', '~> 3'
Expand Down
5 changes: 3 additions & 2 deletions .docker/entrypoint/lib/commands/verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ def options(ignore_urls = nil)
log_level = @context.arguments.log_level
opts[:log_level] = log_level.to_sym unless log_level.nil?
opts[:url_ignore] = ignore_urls if ignore_urls.valid_array?
opts[:cache] = { timeframe: '1h' }
opts[:cache] = { timeframe: { external: '1w' } }

opts
end

def default_options
{
assume_extension: true,
checks: %w[Links Images Scripts UnrenderedLink],
allow_missing_href: true,
check_html: true,
enforce_https: true,
only_4xx: true,
Expand Down
5 changes: 3 additions & 2 deletions .docker/entrypoint/spec/verifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@

it 'receives expected options' do
expected_options = {
assume_extension: true,
checks: ['Links', 'Images', 'Scripts', 'UnrenderedLink'],
allow_missing_href: true,
check_html: true,
check_unrendered_link: true,
enforce_https: true,
Expand All @@ -88,7 +89,7 @@
typheous: {
verbose: false
},
cache: { :timeframe => '1h' }
cache: { timeframe: { external: '1w' } }
}
html_proofer_class = SpecHTMLProofer
html_proofer = html_proofer_class.new
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 2.7.6
bundler-cache: true
working-directory: ${{ env.working-directory }}
- run: bundle exec rake
Expand All @@ -195,7 +195,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 2.7.6
bundler-cache: true

- name: Verify build output
Expand All @@ -206,14 +206,14 @@ jobs:
docker pull "${IMAGE_FQN}"
docker run \
--volume $(pwd)/tests/full:/srv/jekyll \
--env DEBUG=true \
--env DEBUG=false \
--env GITHUB_BRANCH=${{ needs.variables.outputs.build_branch }} \
--env GITHUB_REPOSITORY_URL=${{ github.event.repository.html_url }} \
"${IMAGE_FQN}" \
build \
--verify \
--env=production \
--log-level=debug \
--log-level=error \
--site-url=https://example.com/ \
--ignore-url '%r{[/.]?page1}' \
--ignore-url http://www.wikipedia.org \
Expand Down Expand Up @@ -241,13 +241,13 @@ jobs:
docker pull "${IMAGE_FQN}"
docker run \
--volume $(pwd)/tests/full:/srv/jekyll \
--env DEBUG=true \
--env DEBUG=false \
--env GITHUB_BRANCH=${{ needs.variables.outputs.build_branch }} \
--env GITHUB_REPOSITORY_URL=${{ github.event.repository.html_url }} \
"${IMAGE_FQN}" \
build \
--env=production \
--log-level=debug \
--log-level=error \
--site-url=https://swedbankpay.github.io/jekyll-plantuml-docker/

- name: Verify base URL
Expand Down Expand Up @@ -286,11 +286,11 @@ jobs:
--env GIT_DEPLOY_REPO="${GIT_DEPLOY_REPO}" \
--env PAGES_REPO_NWO="${{ github.repository }}" \
--env JEKYLL_GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
--env DEBUG="true" \
--env DEBUG=false \
${IMAGE_NAME}:${IMAGE_TAG} \
deploy \
--env=production \
--log-level=debug
--log-level=error

cleanup:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion tests/full/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ gem 'rake'
gem 'jekyll-material-icon-tag', '~> 1.1'
gem 'jemoji', '~> 0.12.0'
gem 'kramdown-plantuml', '>= 1.1.12'
gem 'swedbank-pay-design-guide-jekyll-theme', '>= 1.12.4'
55 changes: 15 additions & 40 deletions tests/full/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.3)
activesupport (7.0.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.1.10)
em-websocket (0.5.3)
Expand All @@ -16,29 +16,26 @@ GEM
ethon (0.15.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
faraday (2.3.0)
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.3)
ffi (1.15.5)
forwardable-extended (2.6.0)
gemoji (3.0.1)
html-pipeline (2.14.2)
activesupport (>= 2)
nokogiri (>= 1.4)
html-proofer (3.19.4)
html-proofer (4.4.0)
addressable (~> 2.3)
mercenary (~> 0.3)
nokogiri (~> 1.13)
parallel (~> 1.10)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
html-proofer-unrendered-markdown (0.1.3)
html-proofer (~> 3.0, >= 3.15.1)
zeitwerk (~> 2.5)
html-proofer-unrendered-markdown (0.2.0)
html-proofer (>= 4.0.0)
htmlentities (4.3.4)
http_parser.rb (0.8.0)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.2.2)
addressable (~> 2.4)
Expand All @@ -55,11 +52,7 @@ GEM
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-contentblocks (1.2.0)
jekyll
jekyll-material-icon-tag (1.1.1)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
Expand All @@ -83,52 +76,35 @@ GEM
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
mini_portile2 (2.8.0)
minitest (5.16.1)
nokogiri (1.13.6)
minitest (5.16.3)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
open3 (0.1.1)
parallel (1.22.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
public_suffix (5.0.0)
racc (1.6.0)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.29.0)
ruby2_keywords (0.0.5)
rouge (3.30.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
swedbank-pay-design-guide-jekyll-theme (1.17.0)
faraday (>= 1.0.1, < 3)
html-proofer (~> 3, >= 3.19)
jekyll (>= 3.7, < 5.0)
jekyll-contentblocks (~> 1, >= 1.2)
jekyll-material-icon-tag (~> 1, >= 1.1)
jekyll-redirect-from (~> 0.16)
jemoji (~> 0.12)
kramdown-plantuml (~> 1, >= 1.3.2)
nokogiri (~> 1.11)
rake (~> 13.0)
sass (~> 3, >= 3.7)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (1.8.0)
yell (2.2.2)
zeitwerk (2.6.0)

PLATFORMS
ruby
Expand All @@ -142,7 +118,6 @@ DEPENDENCIES
kramdown-plantuml (>= 1.1.12)
open3 (~> 0.1.1)
rake
swedbank-pay-design-guide-jekyll-theme (>= 1.12.4)

BUNDLED WITH
2.2.26
2 changes: 0 additions & 2 deletions tests/full/_config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
repository: SwedbankPay/jekyll-plantuml-docker
theme: swedbank-pay-design-guide-jekyll-theme
exclude: ["Gemfile*"]
plugins:
- jemoji
- jekyll-material-icon-tag
- kramdown-plantuml
- swedbank-pay-design-guide-jekyll-theme
defaults:
- values:
layout: default
7 changes: 3 additions & 4 deletions tests/full/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ Text can be **bold**, _italic_, or ~~strikethrough~~.
* [Absolute URL to page]({{ page.url | absolute_url }}).
* [Relative URL to CSS file]({{ "/test.css" | relative_url }}).
* [External absolute full link](https://www.wikipedia.org)
* [External protocol relative link](//www.wikipedia.org)
* [Internal absolute full link]({{ site.url }})
* [Internal explicit relative link](./page1)
* [Internal implicit relative link](page1)
* [Internal absolute link](/page1)
* [Internal explicit relative link](./link)
* [Internal implicit relative link](link)
* [Internal absolute link](/link)

There should be whitespace between paragraphs.

Expand Down
2 changes: 0 additions & 2 deletions tests/full/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ description: For testing HTML
---

* This file is linked from [index][index].
* [This is an absolute URL to this page][absolute].
* [And here's a relative URL to this page][relative]

[index]: /
[absolute]: {{ page.url | absolute_url }}
[relative]: {{ "/link" | relative_url }}
6 changes: 2 additions & 4 deletions tests/minimal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ Text can be **bold**, _italic_, or ~~strikethrough~~.
* [Absolute URL to page]({{ page.url | absolute_url }}).
* [Relative URL to page]({{ "/" | relative_url }}).
* [External absolute full link](https://www.wikipedia.org)
* [External protocol relative link](//www.wikipedia.org)
* [Internal absolute full link]({{ site.url }})
* [Internal explicit relative link](./page1)
* [Internal implicit relative link](page1)
* [Internal absolute link](/page1)
* [Internal explicit relative link](./)
* [Internal absolute link](/)

There should be whitespace between paragraphs.

Expand Down