Skip to content

Commit

Permalink
style: auto-gen-only-exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyF committed Dec 6, 2018
1 parent a7088ab commit 741e83d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 24 deletions.
19 changes: 17 additions & 2 deletions .rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-10-26 17:05:15 +0200 using RuboCop version 0.60.0.
# on 2018-12-06 10:04:35 +0100 using RuboCop version 0.61.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -13,7 +13,20 @@ Lint/AmbiguousOperator:
- 'lib/jekyll/commands/page.rb'
- 'lib/jekyll/commands/post.rb'

# Offense count: 5
# Offense count: 13
# Configuration parameters: CountComments, Max, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Exclude:
- 'spec/draft_spec.rb'
- 'spec/file_info_spec.rb'
- 'spec/page_spec.rb'
- 'spec/post_spec.rb'
- 'spec/publish_spec.rb'
- 'spec/spec_helper.rb'
- 'spec/unpublish_spec.rb'

# Offense count: 7
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Expand All @@ -22,3 +35,5 @@ Metrics/LineLength:
- 'lib/jekyll-compose/file_mover.rb'
- 'lib/jekyll/commands/publish.rb'
- 'lib/jekyll/commands/unpublish.rb'
- 'spec/post_spec.rb'
- 'spec/publish_spec.rb'
26 changes: 13 additions & 13 deletions spec/file_info_spec.rb
Expand Up @@ -10,10 +10,10 @@
context "with a title of only words" do
let(:expected_result) do
<<~CONTENT
---
layout: post
title: A test arg parser
---
---
layout: post
title: A test arg parser
---
CONTENT
end

Expand All @@ -33,10 +33,10 @@
context "with a title that includes a colon" do
let(:expected_result) do
<<~CONTENT
---
layout: post
title: 'A test: arg parser'
---
---
layout: post
title: 'A test: arg parser'
---
CONTENT
end

Expand All @@ -56,11 +56,11 @@
context "with custom values" do
let(:expected_result) do
<<~CONTENT
---
layout: post
title: A test
foo: bar
---
---
layout: post
title: A test
foo: bar
---
CONTENT
end

Expand Down
2 changes: 1 addition & 1 deletion spec/post_spec.rb
Expand Up @@ -32,7 +32,7 @@
it "creates a post with a specified date" do
path = posts_dir.join "2012-03-04-a-test-post.md"
expect(path).not_to exist
capture_stdout { described_class.process(args, { "date" => "2012-3-4" }) }
capture_stdout { described_class.process(args, "date" => "2012-3-4") }
expect(path).to exist
expect(File.read(path)).to match(%r!date: 2012-03-04 00:00 \+0000!)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/publish_spec.rb
Expand Up @@ -39,7 +39,7 @@
it "publishes with a specified date" do
path = posts_dir.join "2012-03-04-#{draft_to_publish}"
expect(path).not_to exist
capture_stdout { described_class.process(args, { "date"=>"2012-3-4" }) }
capture_stdout { described_class.process(args, "date"=>"2012-3-4") }
expect(path).to exist
end

Expand All @@ -51,7 +51,7 @@

it "publishes a draft on the specified date" do
path = posts_dir.join "2012-03-04-a-test-post.md"
capture_stdout { described_class.process(args, { "date" => "2012-3-4" }) }
capture_stdout { described_class.process(args, "date" => "2012-3-4") }
expect(path).to exist
end

Expand Down
10 changes: 4 additions & 6 deletions spec/spec_helper.rb
Expand Up @@ -18,9 +18,7 @@

config.warnings = true

if config.files_to_run.one?
config.default_formatter = "doc"
end
config.default_formatter = "doc" if config.files_to_run.one?

config.profile_examples = 3

Expand All @@ -44,9 +42,9 @@ def source_dir(*files)

def fixture_site
Jekyll::Site.new(Jekyll::Utils.deep_merge_hashes(
Jekyll::Configuration::DEFAULTS,
{ "source" => source_dir, "destination" => test_dir("dest") }
))
Jekyll::Configuration::DEFAULTS,
"source" => source_dir, "destination" => test_dir("dest")
))
end

def capture_stdout(level = :debug)
Expand Down

0 comments on commit 741e83d

Please sign in to comment.