diff --git a/.docker/entrypoint/.rubocop.yml b/.docker/entrypoint/.rubocop.yml index 57d49903..1814af83 100644 --- a/.docker/entrypoint/.rubocop.yml +++ b/.docker/entrypoint/.rubocop.yml @@ -1,3 +1,6 @@ +require: + - rubocop-rake + - rubocop-rspec AllCops: NewCops: enable Exclude: @@ -5,7 +8,7 @@ AllCops: - _site/**/* - spec/**/* - vendor/**/* - TargetRubyVersion: 2.7 + TargetRubyVersion: 2.7.6 Layout: LineLength: 100 IndentationStyle: diff --git a/.docker/entrypoint/Gemfile b/.docker/entrypoint/Gemfile index bb659519..dc1f33f2 100644 --- a/.docker/entrypoint/Gemfile +++ b/.docker/entrypoint/Gemfile @@ -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' diff --git a/.docker/entrypoint/lib/commands/verifier.rb b/.docker/entrypoint/lib/commands/verifier.rb index a19c83b5..2e4a2dd2 100644 --- a/.docker/entrypoint/lib/commands/verifier.rb +++ b/.docker/entrypoint/lib/commands/verifier.rb @@ -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, diff --git a/.docker/entrypoint/spec/verifier_spec.rb b/.docker/entrypoint/spec/verifier_spec.rb index aa9d7048..0ff2c865 100644 --- a/.docker/entrypoint/spec/verifier_spec.rb +++ b/.docker/entrypoint/spec/verifier_spec.rb @@ -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, @@ -88,7 +89,7 @@ typheous: { verbose: false }, - cache: { :timeframe => '1h' } + cache: { timeframe: { external: '1w' } } } html_proofer_class = SpecHTMLProofer html_proofer = html_proofer_class.new diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eed7fecd..a2708bc1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 @@ -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 \ @@ -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 @@ -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 diff --git a/tests/full/Gemfile b/tests/full/Gemfile index fe9787b1..a8ef8f0e 100644 --- a/tests/full/Gemfile +++ b/tests/full/Gemfile @@ -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' diff --git a/tests/full/Gemfile.lock b/tests/full/Gemfile.lock index 7cbfffce..518db9cf 100644 --- a/tests/full/Gemfile.lock +++ b/tests/full/Gemfile.lock @@ -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) @@ -16,17 +16,13 @@ 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) @@ -34,11 +30,12 @@ GEM 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) @@ -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) @@ -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 @@ -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 diff --git a/tests/full/_config.yml b/tests/full/_config.yml index 87ef2670..717e6c16 100644 --- a/tests/full/_config.yml +++ b/tests/full/_config.yml @@ -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 diff --git a/tests/full/index.md b/tests/full/index.md index c00d9931..2d1541e7 100644 --- a/tests/full/index.md +++ b/tests/full/index.md @@ -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. diff --git a/tests/full/link.md b/tests/full/link.md index 1abc157c..07cec0cf 100644 --- a/tests/full/link.md +++ b/tests/full/link.md @@ -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 }} diff --git a/tests/minimal/index.md b/tests/minimal/index.md index 3f284fd5..8a72de2d 100644 --- a/tests/minimal/index.md +++ b/tests/minimal/index.md @@ -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.