Skip to content

Commit 1c5cad6

Browse files
ashmarolijekyllbot
authored andcommitted
Reintroduce style checks (#67)
Merge pull request 67
1 parent af88002 commit 1c5cad6

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

.rubocop.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
require: rubocop-jekyll
12
inherit_gem:
2-
jekyll: .rubocop.yml
3+
rubocop-jekyll: .rubocop.yml
34

45
AllCops:
56
TargetRubyVersion: 2.3
67
Exclude:
78
- vendor/**/*
9+
Layout/FirstParameterIndentation:
10+
Exclude:
11+
- spec/**/*
12+
Metrics/BlockLength:
13+
Exclude:
14+
- spec/**/*
15+
Metrics/LineLength:
16+
Exclude:
17+
- spec/**/*

lib/jekyll-mentions.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def mentionify(doc)
4343
def filter_with_mention(src)
4444
filters[src] ||= HTML::Pipeline.new([
4545
HTML::Pipeline::MentionFilter,
46-
], { :base_url => src, :username_pattern => mention_username_pattern })
46+
], :base_url => src, :username_pattern => mention_username_pattern)
4747
end
4848

4949
def mention_username_pattern
@@ -77,8 +77,8 @@ def mention_base(config = {})
7777
mention_config.fetch("base_url", default_mention_base)
7878
else
7979
raise InvalidJekyllMentionConfig,
80-
"Your jekyll-mentions config has to either be a" \
81-
" string or a hash. It's a #{mention_config.class} right now."
80+
"Your jekyll-mentions config has to either be a string or a hash. " \
81+
"It's a #{mention_config.class} right now."
8282
end
8383
end
8484

@@ -117,6 +117,6 @@ def default_mention_base
117117
end
118118
end
119119

120-
Jekyll::Hooks.register %i[pages documents], :post_render do |doc|
120+
Jekyll::Hooks.register [:pages, :documents], :post_render do |doc|
121121
Jekyll::Mentions.mentionify(doc) if Jekyll::Mentions.mentionable?(doc)
122122
end

script/cibuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
set -e
44

55
script/test
6+
script/fmt
67
bundle exec rake build

spec/mentions_spec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
let(:config_overrides) { {} }
77
let(:configs) do
8-
Jekyll.configuration(config_overrides.merge({
9-
"skip_config_files" => false,
10-
"collections" => { "docs" => { "output" => true } },
11-
"source" => fixtures_dir,
12-
"destination" => fixtures_dir("_site"),
13-
}))
8+
Jekyll.configuration(
9+
config_overrides.merge(
10+
"skip_config_files" => false,
11+
"collections" => { "docs" => { "output" => true } },
12+
"source" => fixtures_dir,
13+
"destination" => fixtures_dir("_site")
14+
)
15+
)
1416
end
1517
let(:mentions) { described_class }
1618
let(:default_src) { "https://github.com" }

0 commit comments

Comments
 (0)