Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 662323f

Browse files
authored
Merge pull request #2 from magento/master
Merging from master
2 parents 07d0be5 + 5898f7b commit 662323f

File tree

142 files changed

+1406
-14188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+1406
-14188
lines changed

Gemfile.lock

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
GIT
22
remote: https://github.com/magento-devdocs/devdocs-theme.git
3-
revision: d72768697309f7f13af8a37073af776420f6c3a7
3+
revision: 21c18f2fe396b5d9ba4ca4941fae4b7b48d8ea5a
44
specs:
5-
devdocs (7)
5+
devdocs (9)
66
jekyll (>= 4.0)
77

88
GEM
@@ -13,7 +13,7 @@ GEM
1313
algolia_html_extractor (2.6.2)
1414
json (~> 2.0)
1515
nokogiri (~> 1.10.4)
16-
algoliasearch (1.27.1)
16+
algoliasearch (1.27.2)
1717
httpclient (~> 2.8, >= 2.8.3)
1818
json (>= 1.5.1)
1919
colorator (1.1.0)
@@ -31,7 +31,7 @@ GEM
3131
filesize (0.2.0)
3232
forwardable-extended (2.6.0)
3333
fspath (3.1.2)
34-
html-proofer (3.15.2)
34+
html-proofer (3.15.3)
3535
addressable (~> 2.3)
3636
mercenary (~> 0.3)
3737
nokogumbo (~> 2.0)
@@ -93,7 +93,8 @@ GEM
9393
jekyll-watch (2.2.1)
9494
listen (~> 3.0)
9595
json (2.3.0)
96-
kramdown (2.1.0)
96+
kramdown (2.2.1)
97+
rexml
9798
kramdown-parser-gfm (1.1.0)
9899
kramdown (~> 2.0)
99100
launchy (2.5.0)
@@ -129,12 +130,13 @@ GEM
129130
public_suffix (4.0.4)
130131
rainbow (3.0.0)
131132
rake (13.0.1)
132-
rb-fsevent (0.10.3)
133+
rb-fsevent (0.10.4)
133134
rb-inotify (0.10.1)
134135
ffi (~> 1.0)
135-
rouge (3.17.0)
136+
rexml (3.2.4)
137+
rouge (3.18.0)
136138
safe_yaml (1.0.5)
137-
sassc (2.2.1)
139+
sassc (2.3.0)
138140
ffi (~> 1.9)
139141
sawyer (0.8.2)
140142
addressable (>= 2.3.5)

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ desc "Same as 'rake', 'rake preview'"
2121
task default: %w[preview]
2222

2323
desc "Same as 'test:report'"
24-
task test: %w[test:report]
24+
task test: %w[test:md test:report]
2525

2626
desc 'Preview the devdocs locally'
2727
task preview: %w[install clean] do
@@ -91,4 +91,4 @@ task :convert do
9191
result = `bin/kramdown --input=html --output=kramdown`
9292
puts 'Converted text:'.magenta
9393
puts result.bold
94-
end
94+
end

bin/htmlproofer

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'htmlproofer' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("html-proofer", "htmlproofer")

rakelib/check.rake

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,56 @@
44
# frozen_string_literal: true
55

66
namespace :check do
7-
desc 'Optimize images in modified files, or by path (rake image_optim path=path/to/dir/or/file).'
7+
8+
desc 'Optimize images in modified files, or by path (rake check:img path=path/to/dir/or/file).'
89
task :image_optim do
9-
puts 'Running image optimizer...'.magenta
10+
puts
11+
puts 'Checking images ...'.magenta
1012
path = ENV['path']
13+
1114
unless path
15+
puts 'Looking in uncommitted files ...'.blue
1216
modified_files = `git ls-files --modified --others --exclude-standard`.split("\n")
1317
deleted_files = `git ls-files --deleted`.split("\n")
1418
image_files_to_check = (modified_files - deleted_files).select { |file| File.extname(file) =~ /\.(png|jpg|jpeg|gif)/i }
15-
abort 'Didn\'t find any modified files.'.blue if image_files_to_check.empty?
19+
20+
next puts 'No images to check.'.magenta if image_files_to_check.empty?
21+
1622
path = image_files_to_check.join(' ')
1723
end
24+
1825
system "bin/image_optim --no-pngout --no-svgo --recursive #{path}"
1926
end
2027

21-
desc 'Check Markdown syntax in modified files or in a particular file or directory by path (e.g. path=src/mftf)'
28+
desc 'Check Markdown syntax in modified files or in a particular file or directory by path (e.g. path=mftf)'
2229
task :mdl do
23-
puts 'Running Markdown linter ...'.magenta
30+
puts
31+
puts 'Checking Markdown ...'.magenta
32+
print 'List the rules: $ '.magenta
33+
sh 'bin/mdl -l --style=_checks/styles/style-rules-dev'
34+
puts 'Linting ...'.magenta
2435

2536
path = ENV['path']
37+
2638
unless path
39+
puts 'Looking in uncommitted files ...'.blue
2740
modified_files = `git ls-files --modified --others --exclude-standard`.split("\n")
2841
deleted_files = `git ls-files --deleted`.split("\n")
2942
md_files_to_check = (modified_files - deleted_files).select { |file| File.extname(file) == '.md' }
30-
abort 'Cannot find any modified .md files.'.magenta if md_files_to_check.empty?
43+
44+
next puts 'No Markdown files to check.'.magenta if md_files_to_check.empty?
45+
3146
path = md_files_to_check.join(' ')
3247
end
33-
report = `bin/mdl #{path}`
34-
puts report.yellow
48+
49+
report = `bin/mdl --style=_checks/styles/style-rules-dev --ignore-front-matter -- #{path}`
50+
51+
if report.empty?
52+
puts 'No issues found'.green
53+
else
54+
puts report.yellow
55+
end
56+
3557
puts 'The rules are defined in _checks/styles/style-rules-dev'.magenta
3658
end
3759
end

rakelib/test.rake

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,31 @@
55

66
namespace :test do
77
# Run html-proofer to check for broken links
8-
desc 'Build devdocs and check for broken links'
8+
desc 'Build site, check for broken links, write report to a file'
99
task links: %w[build links_no_build]
1010

11-
# Run htmlproofer to check for broken external links
1211
desc 'Check the existing _site for broken EXTERNAL links'
1312
task :external_links do
1413
puts 'Testing external links'
15-
system 'bundle exec htmlproofer _site/ --external_only'
14+
system 'bin/htmlproofer _site/ --external_only'
1615
end
1716

18-
desc 'Check the entire _site for broken links and invalid HTML'
17+
desc 'Check the existing _site for broken INTERNAL links'
1918
task :html do
20-
puts 'Checking links with html-proofer...'.magenta
19+
puts 'Checking HTML ...'.magenta
2120

2221
LinkChecker.check_site
2322
end
2423

25-
desc 'Check the existing _site for broken links'
24+
desc 'Check the existing _site for broken links and report to a separate file'
2625
task :links_no_build do
2726
begin
2827
# Write console output (stderr only) to a file.
2928
# Use this if you need to also capture stdout: https://stackoverflow.com/a/2480439
3029
report = LinkChecker.md_report_path
3130
$stderr.reopen(report, 'w+')
3231

33-
puts 'Checking links with html-proofer...'.magenta
34-
LinkChecker.check_site
32+
Rake::Task['test:html'].invoke
3533

3634
# We're expecting link validation errors, but unless we rescue from
3735
# StandardError, rake will abort and won't run the convert task (https://stackoverflow.com/a/10048406).
@@ -56,9 +54,14 @@ namespace :test do
5654
print 'List the rules: $ '.magenta
5755
sh 'bin/mdl -l --style=_checks/styles/style-rules-prod'
5856
puts 'Linting ...'.magenta
59-
output = `bin/mdl --style=_checks/styles/style-rules-prod --ignore-front-matter --git-recurse -- .`
57+
output =
58+
`bin/mdl \
59+
--style=_checks/styles/style-rules-prod \
60+
--ignore-front-matter \
61+
--git-recurse \
62+
-- .`
6063
puts output.yellow
61-
abort "The Markdown linter detected #{output.lines.count - 2} issue(s)".red unless output.empty?
62-
puts 'No issues found'.magenta
64+
abort "Fix the reported issues".red unless output.empty?
65+
puts 'No issues found'.green
6366
end
6467
end

src/_data/codebase/cloud/magento-cloud.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)