Skip to content

Commit

Permalink
Merge branch 'cookiecutter-template' into update-from-cookiecutter-20…
Browse files Browse the repository at this point in the history
…21-06-06-1310
  • Loading branch information
apiology committed Jun 6, 2021
2 parents d220749 + 44f7fa5 commit ee45ded
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ GEM
iniparse (1.5.0)
minitest-profile (0.0.2)
mocha (1.12.0)
overcommit (0.57.0)
overcommit (0.58.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
rexml (~> 3.2)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
Expand All @@ -42,16 +43,16 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.15.0)
rubocop (1.16.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.5.0, < 2.0)
rubocop-ast (>= 1.7.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.5.0)
rubocop-ast (1.7.0)
parser (>= 3.0.1.1)
rubocop-rake (0.5.1)
rubocop
Expand Down Expand Up @@ -79,15 +80,14 @@ PLATFORMS
ruby
x86_64-darwin-19
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
bigfiles!
bump
bundler
minitest-profile
mocha
overcommit
overcommit (>= 0.58.0)
rake (~> 13.0)
rspec (>= 3.4)
rubocop
Expand All @@ -98,4 +98,4 @@ DEPENDENCIES
undercover

BUNDLED WITH
2.2.6
2.2.19
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ Gemfile.lock.installed: Gemfile.lock

bundle_install: Gemfile.lock.installed ## Install Ruby dependencies

clean: ## remove all built artifacts
clear_metrics: ## remove or reset result artifacts created by tests and quality tools
bundle exec rake clear_metrics

clean: clear_metrics ## remove all built artifacts

test: spec ## run tests quickly

Expand Down
5 changes: 4 additions & 1 deletion bigfiles.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'minitest-profile'
spec.add_development_dependency 'mocha'
spec.add_development_dependency 'overcommit'
# 0.58.0 and 0.57.0 don't seem super compatible with signatures, and
# magit doesn't seem to want to use the bundled version at the moment,
# so let's favor the more recent version...
spec.add_development_dependency 'overcommit', ['>=0.58.0']
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '>=3.4'
spec.add_development_dependency 'rubocop'
Expand Down
41 changes: 36 additions & 5 deletions fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -o pipefail

apt_upgraded=0

update_apt() {
if [ "${apt_upgraded}" = 0 ]
then
sudo apt-get update -y
apt_upgraded=1
fi
}

install_rbenv() {
if [ "$(uname)" == "Darwin" ]
then
Expand Down Expand Up @@ -77,6 +87,8 @@ ensure_dev_library() {

ensure_ruby_build_requirements() {
ensure_dev_library readline/readline.h readline libreadline-dev
ensure_dev_library zlib.h zlib zlib1g-dev
ensure_dev_library openssl/ssl.h openssl libssl-dev
}

# You can find out which feature versions are still supported / have
Expand All @@ -92,7 +104,17 @@ ensure_ruby_versions() {

for ver in $ruby_versions
do
rbenv install -s "${ver}"
# These CFLAGS can be retired once 2.6.7 is no longer needed :
#
# https://github.com/rbenv/ruby-build/issues/1747
# https://github.com/rbenv/ruby-build/issues/1489
# https://bugs.ruby-lang.org/issues/17777
if [ "${ver}" == 2.6.7 ]
then
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install -s "${ver}"
else
rbenv install -s "${ver}"
fi
done
}

Expand All @@ -101,7 +123,17 @@ ensure_bundle() {
#
# https://app.circleci.com/pipelines/github/apiology/source_finder/21/workflows/88db659f-a4f4-4751-abc0-46f5929d8e58/jobs/107
set_rbenv_env_variables
bundle --version >/dev/null 2>&1 || gem install bundler
bundle --version >/dev/null 2>&1 || gem install --no-document bundler
bundler_version=$(bundle --version | cut -d ' ' -f3)
bundler_version_major=$(cut -d. -f1 <<< "${bundler_version}")
bundler_version_minor=$(cut -d. -f2 <<< "${bundler_version}")
# Version 2.1 of bundler seems to have some issues with nokogiri:
#
# https://app.asana.com/0/1107901397356088/1199504270687298
if [ "${bundler_version_major}" == 2 ] && [ "${bundler_version_minor}" -lt 2 ]
then
gem install --no-document bundler
fi
make bundle_install
# https://bundler.io/v2.0/bundle_lock.html#SUPPORTING-OTHER-PLATFORMS
#
Expand Down Expand Up @@ -156,8 +188,6 @@ set_pyenv_env_variables() {
set +u
export PYENV_ROOT="${HOME}/.pyenv"
export PATH="${PYENV_ROOT}/bin:$PATH"
# TODO: This can be removed once Homebrew updates pyenv past 1.2.27
eval "$(pyenv init -)"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
set -u
Expand All @@ -183,7 +213,7 @@ install_package() {
HOMEBREW_NO_AUTO_UPDATE=1 brew install "${homebrew_package}"
elif type apt-get >/dev/null 2>&1
then
sudo apt-get update -y
update_apt
sudo apt-get install -y "${apt_package}"
else
>&2 echo "Teach me how to install packages on this plaform"
Expand All @@ -196,6 +226,7 @@ ensure_python_build_requirements() {
ensure_dev_library bzlib.h bzip2 libbz2-dev
ensure_dev_library openssl/ssl.h openssl libssl-dev
ensure_dev_library ffi.h libffi libffi-dev
ensure_dev_library sqlite3.h sqlite3 libsqlite3-dev
}

# You can find out which feature versions are still supported / have
Expand Down
11 changes: 10 additions & 1 deletion rakelib/clear_metrics.rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# frozen_string_literal: true

desc 'Rebaseline quality thresholds to last commit'
desc 'Ensure that any locally ratcheted coverage metrics are cleared back ' \
'to git baseline'
task :clear_metrics do |_t|
ret =
system('git checkout coverage/.last_run.json')
raise unless ret

# Without this old lines which are removed are still counted,
# leading to inconsistent coverage percentages between runs.
#
# need to save coverage/.last_run.json
ret =
system('rm -fr coverage/assets coverage/.*.json.lock coverage/lcov/* coverage/index.html coverage/.resultset.json')
raise unless ret
end

0 comments on commit ee45ded

Please sign in to comment.