mirror of
https://github.com/aljazceru/hacker-gh-pages-theme.git
synced 2025-12-17 14:14:23 +01:00
Rely on rubocop-github for Ruby formatting
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
|
inherit_gem:
|
||||||
|
rubocop-github:
|
||||||
|
- config/default.yml
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- _site/**/*
|
- _site/**/*
|
||||||
|
|
||||||
Metrics/LineLength:
|
Layout/LineLength:
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Gemspec/RequiredRubyVersion:
|
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
2
Gemfile
2
Gemfile
@@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source 'https://rubygems.org'
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gemspec
|
gemspec
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = 'jekyll-theme-hacker'
|
s.name = "jekyll-theme-hacker"
|
||||||
s.version = '0.1.2'
|
s.version = "0.1.2"
|
||||||
s.license = 'CC0-1.0'
|
s.license = "CC0-1.0"
|
||||||
s.authors = ['Jason Costello', 'GitHub, Inc.']
|
s.authors = ["Jason Costello", "GitHub, Inc."]
|
||||||
s.email = ['opensource+jekyll-theme-hacker@github.com']
|
s.email = ["opensource+jekyll-theme-hacker@github.com"]
|
||||||
s.homepage = 'https://github.com/pages-themes/hacker'
|
s.homepage = "https://github.com/pages-themes/hacker"
|
||||||
s.summary = 'Hacker is a Jekyll theme for GitHub Pages'
|
s.summary = "Hacker is a Jekyll theme for GitHub Pages"
|
||||||
|
|
||||||
s.files = `git ls-files -z`.split("\x0").select do |f|
|
s.files = `git ls-files -z`.split("\x0").select do |f|
|
||||||
f.match(%r{^((_includes|_layouts|_sass|assets)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
|
f.match(%r{^((_includes|_layouts|_sass|assets)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
s.required_ruby_version = ">= 2.4.0"
|
||||||
|
|
||||||
s.platform = Gem::Platform::RUBY
|
s.platform = Gem::Platform::RUBY
|
||||||
s.add_runtime_dependency 'jekyll', '> 3.5', '< 5.0'
|
s.add_runtime_dependency "jekyll", "> 3.5", "< 5.0"
|
||||||
s.add_runtime_dependency 'jekyll-seo-tag', '~> 2.0'
|
s.add_runtime_dependency "jekyll-seo-tag", "~> 2.0"
|
||||||
s.add_development_dependency 'html-proofer', '~> 3.0'
|
s.add_development_dependency "html-proofer", "~> 3.0"
|
||||||
s.add_development_dependency 'rubocop', '~> 0.50'
|
s.add_development_dependency "rubocop-github", "~> 0.16"
|
||||||
s.add_development_dependency 'w3c_validators', '~> 1.3'
|
s.add_development_dependency "w3c_validators", "~> 1.3"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'w3c_validators'
|
require "w3c_validators"
|
||||||
|
|
||||||
def validator(file)
|
def validator(file)
|
||||||
extension = File.extname(file)
|
extension = File.extname(file)
|
||||||
if extension == '.html'
|
if extension == ".html"
|
||||||
W3CValidators::NuValidator.new
|
W3CValidators::NuValidator.new
|
||||||
elsif extension == '.css'
|
elsif extension == ".css"
|
||||||
W3CValidators::CSSValidator.new
|
W3CValidators::CSSValidator.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -18,11 +18,11 @@ def validate(file)
|
|||||||
path = File.expand_path "../_site/#{file}", __dir__
|
path = File.expand_path "../_site/#{file}", __dir__
|
||||||
results = validator(file).validate_file(path)
|
results = validator(file).validate_file(path)
|
||||||
|
|
||||||
return puts 'Valid!' if results.errors.empty?
|
return puts "Valid!" if results.errors.empty?
|
||||||
|
|
||||||
results.errors.each { |err| puts err.to_s }
|
results.errors.each { |err| puts err.to_s }
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
validate 'index.html'
|
validate "index.html"
|
||||||
validate File.join 'assets', 'css', 'style.css'
|
validate File.join "assets", "css", "style.css"
|
||||||
|
|||||||
Reference in New Issue
Block a user