Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 31 additions & 25 deletions .git-hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,39 @@ begin
# Is the first character a GitMoji?
gitmoji_index = full_text =~ Gitmoji::Regex::REGEX
if gitmoji_index == 0
exit 0
exit(0)
else
denied = <<EOM
Oh snap, think again...

______ _______ ___ _______ _______ _______ _______ ______ __
| _ | | | | || || || || || | | |
| | || | ___| | || ___|| ||_ _|| ___|| _ || |
| |_||_ | |___ | || |___ | | | | | |___ | | | || |
| __ || ___| ___| || ___|| _| | | | ___|| |_| ||__|
| | | || |___ | || |___ | |_ | | | |___ | | __
|___| |_||_______||_______||_______||_______| |___| |_______||______| |__|


Did you forget to add a relevant gitmoji? (see https://gitmoji.dev/ for tools)
In this project, a Gitmoji must be the first grapheme of the commit message.
What's a grapheme?
A symbol rendered to be visually identifiable as a single character, but which may be composed of multiple Unicode code points)
Must match: #{Gitmoji::Regex::REGEX.to_s}
#{gitmoji_index ? "Found a gitmoji at character index #{gitmoji_index}... not good enough.\n" : ""}
Example: git commit -m "✨ My excellent new feature"

EOM
denied = <<~EOM
Oh snap, think again...
______ _______ ___ _______ _______ _______ _______ ______ __
| _ | | | | || || || || || | | |
| | || | ___| | || ___|| ||_ _|| ___|| _ || |
| |_||_ | |___ | || |___ | | | | | |___ | | | || |
| __ || ___| ___| || ___|| _| | | | ___|| |_| ||__|
| | | || |___ | || |___ | |_ | | | |___ | | __
|___| |_||_______||_______||_______||_______| |___| |_______||______| |__|
Did you forget to add a relevant gitmoji? (see https://gitmoji.dev/ for tools)
In this project, a Gitmoji must be the first grapheme of the commit message.
What's a grapheme?
A symbol rendered to be visually identifiable as a single character, but which may be composed of multiple Unicode code points)
Must match: #{Gitmoji::Regex::REGEX}
#{"Found a gitmoji at character index #{gitmoji_index}... not good enough.\n" if gitmoji_index}
Example: git commit -m "✨ My excellent new feature"
EOM
puts denied
exit 1
exit(1)
end
rescue LoadError => e
warn("gitmoji-regex gem not found: #{e.class}: #{e.message}.\n\tSkipping gitmoji check and allowing commit to proceed.\n\tRecommendation: add 'gitmoji-regex' to your development dependencies to enable this check.")
exit 0
failure = <<~EOM
gitmoji-regex gem not found: #{e.class}: #{e.message}.
Skipping gitmoji check and allowing commit to proceed.
Recommendation: add 'gitmoji-regex' to your development dependencies to enable this check.

EOM
warn(failure)
exit(0)
end
2 changes: 1 addition & 1 deletion .git-hooks/footer-template.erb.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
⚡️ A message from a fellow meat-based-AI ⚡️
- [❤️] Finely-crafted open-source tools like <%= @gem_name %> (& many more) are a full-time endeavor.
- [❤️] Finely-crafted open-source tools like <%= @gem_name %> (& many more) require time and effort.
- [❤️] Though I adore my work, it lacks financial sustainability.
- [❤️] Please, help me continue enhancing your tools by becoming a sponsor:
- [💲] https://liberapay.com/pboling/donate
Expand Down
17 changes: 3 additions & 14 deletions .git-hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
# Fail on error and unset variables
set -eu

# Determine project root as the parent directory of this hook script
PROJECT_ROOT="$(CDPATH= cd -- "$(dirname -- "$0")"/.. && pwd)"

# Run the Ruby hook within the direnv context (if available),
# so ENV from .envrc/.env.local at project root is loaded.
# One of the things .envrc needs to do is add $PROJECT_ROOT/bin/ to the path.
# You should have this line at the top of .envrc
# PATH_add bin
# NOTE: If this project ships exe scripts it should also add that.
if command -v direnv >/dev/null 2>&1; then
exec direnv exec "$PROJECT_ROOT" "kettle-commit-msg" "$@"
else
raise "direnv not found. Local development of this project ($PROJECT_ROOT) with tools from the kettle-dev gem may not work properly. Please run 'brew install direnv'."
fi
# We are not using direnv exec here because mise and direnv can result in conflicting PATH settings:
# See: https://mise.jdx.dev/direnv.html
exec "kettle-commit-msg" "$@"
40 changes: 33 additions & 7 deletions .github/workflows/current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ jobs:

steps:
- name: Checkout
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: actions/checkout@v5

- name: Setup Ruby & RubyGems
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -79,11 +79,37 @@ jobs:
# We need to do this first to get appraisal installed.
# NOTE: This does not use the primary Gemfile at all.
- name: Install Root Appraisal
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}

- name: "[Attempt 1] Install Root Appraisal"
id: bundleAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Install Root Appraisal"
id: bundleAttempt2
# If bundleAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt2
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}

- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
40 changes: 26 additions & 14 deletions .github/workflows/dep-heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ jobs:
rubygems: latest
bundler: latest

# truffleruby-24.1
# (according to documentation: targets Ruby 3.3 compatibility)
# (according to runtime: targets Ruby 3.2 compatibility)
# truffleruby-24.1 (targets Ruby 3.3 compatibility)
- ruby: "truffleruby"
appraisal: "dep-heads"
exec_cmd: "rake test"
Expand All @@ -67,11 +65,11 @@ jobs:

steps:
- name: Checkout
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: actions/checkout@v5

- name: Setup Ruby & RubyGems
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -82,24 +80,38 @@ jobs:
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
# We need to do this first to get appraisal installed.
# NOTE: This does not use the primary Gemfile at all.
- name: "Install Root Appraisal"
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: Install Root Appraisal
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: "[Attempt 1] Install Root Appraisal"
id: bundleAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Install Root Appraisal"
id: bundleAttempt2
# If bundleAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
# If bundleAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
id: bundleAttempt2
id: bundleAppraisalAttempt2
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle

- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
36 changes: 25 additions & 11 deletions .github/workflows/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ jobs:

steps:
- name: Checkout
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: actions/checkout@v5

- name: Setup Ruby & RubyGems
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -79,24 +79,38 @@ jobs:
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
# We need to do this first to get appraisal installed.
# NOTE: This does not use the primary Gemfile at all.
- name: "Install Root Appraisal"
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: Install Root Appraisal
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: "[Attempt 1] Install Root Appraisal"
id: bundleAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Install Root Appraisal"
id: bundleAttempt2
# If bundleAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle

- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
id: bundleAppraisalAttempt1
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
# Continue to the next step on failure
continue-on-error: true

# Effectively an automatic retry of the previous step.
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
# If bundleAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
id: bundleAttempt2
id: bundleAppraisalAttempt2
# If bundleAppraisalAttempt1 failed, try again here; Otherwise skip.
if: ${{ steps.bundleAppraisalAttempt1.outcome == 'failure' && (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle

- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
if: ${{ (env.ACT && !(startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) || (!env.ACT && (startsWith(matrix.ruby, 'jruby')) || startsWith(matrix.ruby, 'truffleruby')) }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
4 changes: 2 additions & 2 deletions .github/workflows/legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
appraisal: "ruby-3-1"
exec_cmd: "rake test"
gemfile: "Appraisal.root"
rubygems: latest
bundler: latest
rubygems: '3.6.9'
bundler: '2.6.9'

steps:
- name: Checkout
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ jobs:
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
- name: Run ${{ matrix.appraisal }} checks via ${{ matrix.exec_cmd }}
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}
- name: Validate RBS Types
run: bundle exec appraisal ${{ matrix.appraisal }} bin/rbs validate
Loading
Loading