Skip to content

Commit

Permalink
Merge branch 'master' into Cloud-Docker-1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maeker12 authored and maeker12 committed Sep 22, 2020
2 parents caa18a7 + 59b6136 commit e2d21ea
Show file tree
Hide file tree
Showing 152 changed files with 1,274 additions and 946 deletions.
25 changes: 25 additions & 0 deletions .github/linters/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"default": false,
"MD001": true,
"MD003": { "style": "atx" },
"MD004": true,
"MD005": true,
"MD006": true,
"MD007": { "indent": 3 },
"MD009": true,
"MD010": true,
"MD012": true,
"MD018": true,
"MD019": true,
"MD023": true,
"MD025": true,
"MD029": true,
"MD030": { "ol_single": 1, "ol_multi": 1, "ul_single": 2, "ul_multi": 2 },
"MD032": true,
"MD035": true,
"MD036": true,
"MD037": true,
"MD038": true,
"MD040": true,
"MD046": { "style": "fenced"}
}
11 changes: 11 additions & 0 deletions .github/linters/.ruby-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
#######################
# Rubocop Config file #
#######################

inherit_gem:
rubocop-github:
- config/default.yml

Style/StringLiterals:
EnforcedStyle: single_quotes
57 changes: 57 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
###########################
###########################
## Linter GitHub Actions ##
###########################
###########################
name: Lint Code Base

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
pull_request:
branches:
- master
- 2.*-develop
paths-ignore:
- '**.md'
- '**.html'
- '**.xml'

###############
# Set the Job #
###############
jobs:

build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
VALIDATE_HTML: false
VALIDATE_MD: false
1 change: 1 addition & 0 deletions .markdownlint.json
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ source 'https://rubygems.org'

gem 'devdocs', git: 'https://github.com/magento-devdocs/devdocs-theme.git'
gem 'jekyll'
gem 'whatsup_github'
gem 'rake'
gem 'whatsup_github'

gem 'wdm', platform: :mswin

group :test do
gem 'html-proofer'
gem 'mdl'
gem 'launchy'
gem 'mdl'
end

group :optimization do
Expand All @@ -22,9 +22,9 @@ end

group :jekyll_plugins do
gem 'jekyll-algolia', '~> 1.0'
gem 'jekyll-optional-front-matter'
gem 'jekyll-redirect-from'
gem 'jekyll-relative-links'
gem 'jekyll-sitemap'
gem 'jekyll-titles-from-headings'
gem 'jekyll-relative-links'
gem 'jekyll-optional-front-matter'
end
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ desc 'Generate data for a news digest. Default timeframe is a week since today.
task :whatsnew do
date = ENV['since']
print 'Generating data for the weekly digest: $ '.magenta
if date.nil? or date.empty?
if date.nil? || date.empty?
sh 'bin/whatsup_github'
elsif date.is_a? String
sh 'bin/whatsup_github', 'since', ENV['since'].to_s
Expand All @@ -84,8 +84,8 @@ desc 'Generate index for Algolia'
task index: %w[init] do
puts 'Generating index for Algolia ...'
sh 'bin/jekyll',
'algolia',
'--config=_config.yml,_config.index.yml'
'algolia',
'--config=_config.yml,_config.index.yml'
end

desc 'Convert HTML text to kramdown in your terminal'
Expand All @@ -94,4 +94,4 @@ task :convert do
result = `bin/kramdown --input=html --output=kramdown`
puts 'Converted text:'.magenta
puts result.bold
end
end
8 changes: 5 additions & 3 deletions _plugins/algolia.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# frozen_string_literal: true

# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

module Jekyll
module Algolia
module Hooks
def self.before_indexing_each(record, node, context)
def self.before_indexing_each(record, _node, _context)
# Do not index records larger than 20000 bytes
return nil if record.to_s.bytesize > 20000
return nil if record.to_s.bytesize > 20_000

record
end
end
Expand Down
8 changes: 5 additions & 3 deletions _plugins/liquid-tags/collapsible.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

Expand Down Expand Up @@ -30,7 +32,7 @@ def render(context)
<b class="collapsible-title">#{@title}</b>
<div class="collapsible-content">#{content}</div>
</div>
HTML
HTML
end
end

Expand Down Expand Up @@ -58,7 +60,7 @@ def render(context)
<h2 class="collapsible-title">#{@title}</h2>
<div class="collapsible-content">#{content}</div>
</div>
HTML
HTML
end
end

Expand All @@ -85,7 +87,7 @@ def render(context)
<h3 class="collapsible-title">#{@title}</h3>
<div class="collapsible-content">#{content}</div>
</div>
HTML
HTML
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
# The parameter contains a file path relative to its repository.
#
Jekyll::Hooks.register :pages, :post_init do |page|

# Skip virtual pages like MRG topics
next if page.kind_of? Jekyll::PageWithoutAFile
next if page.is_a? Jekyll::PageWithoutAFile
# Process only files with 'md' and 'html' extensions
next unless File.extname(page.path).match?(/md|html/)
# Skip redirects
Expand All @@ -22,7 +21,7 @@
page.site.source,
File.dirname(page.path)
)

filename = File.basename page.path

# Change to the parent directory of the page and read full file path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
next if page.data['last_modified_at']

# Skip pages created by custom generators like 'mrg_pages'
next if page.kind_of? Jekyll::PageWithoutAFile
next if page.is_a? Jekyll::PageWithoutAFile

# Add site.source to the page path
file_path = File.join(page.site.source, page.path)

# Get real path of the page. If this is a symlink read it to get path of the real file with content.
real_filepath = File.realpath(file_path)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
filtering_pattern = '/guides/v'

next if page.url.start_with? filtering_pattern

page.data['versionless'] = true
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
urls_filtered_by_pattern =
pages.select do |site_page|
next if site_page.name == 'redirect.html'

site_page.url.start_with? filtering_pattern
end.map(&:url)

Expand Down
14 changes: 7 additions & 7 deletions bin/htmlproofer
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)
bundle_binstub = File.expand_path('bundle', __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
Expand All @@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
end
end

require "rubygems"
require "bundler/setup"
require 'rubygems'
require 'bundler/setup'

load Gem.bin_path("html-proofer", "htmlproofer")
load Gem.bin_path('html-proofer', 'htmlproofer')
14 changes: 7 additions & 7 deletions bin/image_optim
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)
bundle_binstub = File.expand_path('bundle', __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
Expand All @@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
end
end

require "rubygems"
require "bundler/setup"
require 'rubygems'
require 'bundler/setup'

load Gem.bin_path("image_optim", "image_optim")
load Gem.bin_path('image_optim', 'image_optim')
6 changes: 4 additions & 2 deletions bin/jekyll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
Expand All @@ -7,8 +9,8 @@
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'
Expand Down
14 changes: 7 additions & 7 deletions bin/kramdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)
bundle_binstub = File.expand_path('bundle', __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
Expand All @@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
end
end

require "rubygems"
require "bundler/setup"
require 'rubygems'
require 'bundler/setup'

load Gem.bin_path("kramdown", "kramdown")
load Gem.bin_path('kramdown', 'kramdown')
14 changes: 7 additions & 7 deletions bin/mdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)

bundle_binstub = File.expand_path("../bundle", __FILE__)
bundle_binstub = File.expand_path('bundle', __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
Expand All @@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
end
end

require "rubygems"
require "bundler/setup"
require 'rubygems'
require 'bundler/setup'

load Gem.bin_path("mdl", "mdl")
load Gem.bin_path('mdl', 'mdl')
Loading

0 comments on commit e2d21ea

Please sign in to comment.