Skip to content

Commit

Permalink
wiki: Add newline check to validate.rb
Browse files Browse the repository at this point in the history
Change-Id: I8d8efe71514bb2682411a6b72feaaec8cd6ba7f9
  • Loading branch information
luk1337 committed Jul 14, 2024
1 parent 19686dd commit 165a9e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/validate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,21 @@ def validate_yaml_lint(path)
update_template = load_template('update.md')
upgrade_template = load_template('upgrade.md')

Dir.glob(wiki_dir + '**/*.*').each do |filename|
next if filename.start_with?(wiki_dir + ".jekyll-cache/")
next if filename.start_with?(wiki_dir + "_site/")
next if filename.start_with?(wiki_dir + "vendor/bundle/")
next if filename.end_with?(".bmp")
next if filename.end_with?(".ico")
next if filename.end_with?(".jpg")
next if filename.end_with?(".png")

if IO.read(filename)[0::-1] != "\n"
puts to_relative_path(filename) + ': Missing newline at the end of file'
at_exit { exit false }
end
end

Dir.glob(wiki_dir + '**/*.yml').each do |filename|
next if filename == wiki_dir + "_config.yml"
next if filename.start_with?(wiki_dir + "vendor/bundle/")
Expand Down

0 comments on commit 165a9e7

Please sign in to comment.