-
Notifications
You must be signed in to change notification settings - Fork 104
Modernize tests & linting #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
97fb23e
058bea9
c063b2c
0a96550
c33b000
03e057c
5003f9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
inherit_gem: | ||
jekyll: .rubocop.yml | ||
|
||
AllCops: | ||
TargetRubyVersion: 2.1 | ||
Exclude: | ||
- vendor/**/* | ||
|
||
Lint/ShadowingOuterLocalVariable: | ||
Exclude: | ||
- lib/jekyll-archives.rb | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- test/**/*.rb | ||
|
||
Metrics/LineLength: | ||
Exclude: | ||
- test/**/*.rb | ||
- lib/jekyll-archives.rb | ||
- lib/jekyll-archives/archive.rb | ||
- test/**/*.rb |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ rvm: | |
|
||
env: | ||
- "" | ||
- JEKYLL_VERSION=3.4 | ||
- JEKYLL_VERSION=3.6 | ||
|
||
matrix: | ||
include: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,11 @@ Gem::Specification.new do |s| | |
|
||
s.homepage = "https://github.com/jekyll/jekyll-archives" | ||
s.licenses = ["MIT"] | ||
s.files = ["lib/jekyll-archives.rb", "lib/jekyll-archives/archive.rb"] | ||
|
||
s.add_dependency "jekyll", ">= 2.4" | ||
all_files = `git ls-files -z`.split("\x0") | ||
s.files = all_files.grep(%r!^(lib)/!) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use Dir globbing instead of |
||
|
||
s.add_dependency "jekyll", ">= 3.1" | ||
|
||
s.add_development_dependency "minitest" | ||
s.add_development_dependency "rake" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,7 @@ class Archives < Jekyll::Generator | |
}.freeze | ||
|
||
def initialize(config = nil) | ||
@config = if config["jekyll-archives"].nil? | ||
DEFAULTS | ||
else | ||
Utils.deep_merge_hashes(DEFAULTS, config["jekyll-archives"]) | ||
end | ||
@config = Utils.deep_merge_hashes(DEFAULTS, config.fetch("jekyll-archives", {})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ |
||
end | ||
|
||
def generate(site) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
set -ex | ||
|
||
bundle install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
#! /bin/sh | ||
#!/bin/bash | ||
set -e | ||
|
||
bundle exec rubocop -S -D -E | ||
echo "Rubocop $(bundle exec rubocop --version)" | ||
bundle exec rubocop -S -D -E $@ | ||
success=$? | ||
if ((success != 0)); then | ||
echo -e "\nTry running \`script/fmt -a\` to automatically fix errors" | ||
fi | ||
exit $success |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
# Tag and push a release. | ||
|
||
set -e | ||
|
||
script/cibuild | ||
bundle exec rake release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do? Suppress ruby warnings in the test output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!