Skip to content

Commit b741c21

Browse files
authored
Merge pull request #31 from fnordfish/chore
Chore
2 parents edc424d + a4b4ba2 commit b741c21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+737
-575
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ruby:3.4
2+
3+
ARG USERNAME=vscode
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
RUN apt-get update && apt-get upgrade -y && \
8+
apt-get install -y curl wget git procps && \
9+
gem update --system && \
10+
gem update bundler && \
11+
# Add unprivileged user
12+
groupadd --gid $USER_GID $USERNAME && \
13+
useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME && \
14+
# Cleaning up
15+
apt-get autoremove -y && \
16+
apt-get clean -y && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
COPY ./docker-entrypoint.sh /
20+
21+
USER $USERNAME
22+
ENV GEM_HOME="/home/$USERNAME/.gem/ruby/$RUBY_VERSION"
23+
ENV PATH=$GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
24+
RUN mkdir -p $GEM_HOME
25+
26+
ENTRYPOINT ["/docker-entrypoint.sh"]

.devcontainer/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
5+
6+
gem "ruby-lsp"
7+
gem "standard"

.devcontainer/Gemfile.lock

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.3)
5+
json (2.13.2)
6+
language_server-protocol (3.17.0.5)
7+
lint_roller (1.1.0)
8+
logger (1.7.0)
9+
parallel (1.27.0)
10+
parser (3.3.9.0)
11+
ast (~> 2.4.1)
12+
racc
13+
prism (1.4.0)
14+
racc (1.8.1)
15+
rainbow (3.1.1)
16+
rbs (3.9.4)
17+
logger
18+
regexp_parser (2.11.2)
19+
rubocop (1.75.8)
20+
json (~> 2.3)
21+
language_server-protocol (~> 3.17.0.2)
22+
lint_roller (~> 1.1.0)
23+
parallel (~> 1.10)
24+
parser (>= 3.3.0.2)
25+
rainbow (>= 2.2.2, < 4.0)
26+
regexp_parser (>= 2.9.3, < 3.0)
27+
rubocop-ast (>= 1.44.0, < 2.0)
28+
ruby-progressbar (~> 1.7)
29+
unicode-display_width (>= 2.4.0, < 4.0)
30+
rubocop-ast (1.46.0)
31+
parser (>= 3.3.7.2)
32+
prism (~> 1.4)
33+
rubocop-performance (1.25.0)
34+
lint_roller (~> 1.1)
35+
rubocop (>= 1.75.0, < 2.0)
36+
rubocop-ast (>= 1.38.0, < 2.0)
37+
ruby-lsp (0.26.1)
38+
language_server-protocol (~> 3.17.0)
39+
prism (>= 1.2, < 2.0)
40+
rbs (>= 3, < 5)
41+
ruby-progressbar (1.13.0)
42+
standard (1.50.0)
43+
language_server-protocol (~> 3.17.0.2)
44+
lint_roller (~> 1.0)
45+
rubocop (~> 1.75.5)
46+
standard-custom (~> 1.0.0)
47+
standard-performance (~> 1.8)
48+
standard-custom (1.0.2)
49+
lint_roller (~> 1.0)
50+
rubocop (~> 1.50)
51+
standard-performance (1.8.0)
52+
lint_roller (~> 1.1)
53+
rubocop-performance (~> 1.25.0)
54+
unicode-display_width (3.1.5)
55+
unicode-emoji (~> 4.0, >= 4.0.4)
56+
unicode-emoji (4.0.4)
57+
58+
PLATFORMS
59+
aarch64-linux
60+
ruby
61+
62+
DEPENDENCIES
63+
ruby-lsp
64+
standard
65+
66+
BUNDLED WITH
67+
2.7.1

.devcontainer/devcontainer.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
3+
{
4+
"name": "Teckel",
5+
"dockerFile": "Dockerfile",
6+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
7+
// "image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye"
8+
9+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
// "forwardPorts": [],
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "bundle install",
19+
20+
"shutdownAction": "stopContainer",
21+
22+
// Configure tool-specific properties.
23+
"customizations": {
24+
"vscode": {
25+
"extensions": [
26+
"shopify.ruby-extensions-pack"
27+
],
28+
"settings": {
29+
"[ruby]": {
30+
"editor.defaultFormatter": "Shopify.ruby-lsp", // Use the Ruby LSP as the default formatter
31+
"editor.formatOnSave": true, // Format files automatically when saving
32+
"editor.tabSize": 2, // Use 2 spaces for indentation
33+
"editor.insertSpaces": true, // Use spaces and not tabs for indentation
34+
"editor.semanticHighlighting.enabled": true, // Enable semantic highlighting
35+
"editor.formatOnType": true // Enable formatting while typing
36+
},
37+
"rubyLsp.addonSettings": {},
38+
"rubyLsp.bundleGemfile": ".devcontainer/Gemfile",
39+
// "rubyLsp.rubyExecutablePath": "chruby-exec ruby",
40+
"rubyLsp.enabledFeatures": {
41+
"codeActions": true,
42+
"codeLens": true,
43+
"completion": true,
44+
"definition": true,
45+
"diagnostics": true,
46+
"documentHighlights": true,
47+
"documentLink": true,
48+
"documentSymbols": true,
49+
"foldingRanges": true,
50+
"formatting": true,
51+
"hover": true,
52+
"inlayHint": true,
53+
"onTypeFormatting": true,
54+
"selectionRanges": true,
55+
"semanticHighlighting": true,
56+
"signatureHelp": true,
57+
"typeHierarchy": true,
58+
"workspaceSymbol": true
59+
},
60+
"rubyLsp.formatter": "standard",
61+
"rubyLsp.linters": [
62+
"standard"
63+
],
64+
"rubyLsp.featureFlags": {
65+
"all": true
66+
}
67+
}
68+
}
69+
},
70+
71+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
72+
// "remoteUser": "root"
73+
"remoteUser": "vscode"
74+
}

.devcontainer/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -e
3+
4+
unset BUNDLE_PATH
5+
unset BUNDLE_BIN
6+
7+
exec "$@"

.github/workflows/pages_specs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
with:
2121
persist-credentials: false
2222
- name: Set up Ruby
23-
uses: actions/setup-ruby@v1
23+
uses: ruby/setup-ruby@v1
2424
with:
25-
ruby-version: '2.7'
25+
ruby-version: '3.4'
26+
bundler-cache: true
2627
- name: Setup python
2728
uses: actions/setup-python@v1
2829
with:

.github/workflows/specs.yml

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,70 @@ jobs:
1414
lint:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1818
- name: Set up Ruby
1919
uses: ruby/setup-ruby@v1
2020
with:
21-
ruby-version: "2.4"
21+
ruby-version: "3.4"
2222
- name: Install bundler
23-
run: gem install bundler
24-
- name: Run rubocop
25-
run: bin/rubocop -ESD
23+
run: gem install standard
24+
- name: Run standardrb
25+
run: standardrb
2626

27-
spec:
27+
test:
2828
runs-on: ubuntu-latest
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
ruby: ["2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "jruby", "truffleruby"]
33-
include:
34-
- ruby: "3.0"
35-
coverage: "true"
32+
ruby:
33+
- "2.4"
34+
- "2.5"
35+
- "2.6"
36+
- "2.7"
37+
- "3.0"
38+
- "3.1"
39+
- "3.2"
40+
- "3.3"
41+
- "3.4"
42+
- "head"
43+
- "jruby-9.4"
44+
- "jruby-10"
45+
- "truffleruby"
3646
steps:
37-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v4
3848
- name: Set up Ruby
3949
uses: ruby/setup-ruby@v1
4050
with:
4151
ruby-version: ${{matrix.ruby}}
4252
bundler-cache: true
53+
- if: ${{ matrix.ruby == 'truffleruby' }}
54+
name: Ruby specs
55+
run: bundle exec rspec
56+
- if: ${{ matrix.ruby != 'truffleruby' }}
57+
name: Run all tests
58+
run: bundle exec rake
59+
60+
coverage:
61+
runs-on: ubuntu-latest
62+
needs: test
63+
steps:
64+
- uses: actions/checkout@v4
65+
- name: Set up Ruby
66+
uses: ruby/setup-ruby@v1
67+
with:
68+
ruby-version: "3.4"
69+
bundler-cache: true
4370
- name: Download test reporter
44-
if: "matrix.coverage == 'true'"
4571
run: |
4672
mkdir -p tmp/
47-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.9.0-linux-amd64 > ./tmp/cc-test-reporter
73+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
4874
chmod +x ./tmp/cc-test-reporter
4975
./tmp/cc-test-reporter before-build
50-
- name: Bundle install
51-
env:
52-
COVERAGE: ${{matrix.coverage}}
53-
run: |
54-
gem install bundler
55-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
5676
- name: Run all tests
5777
env:
58-
COVERAGE: ${{matrix.coverage}}
59-
run: bundle exec rake
78+
COVERAGE: "true"
79+
run: bundle exec rspec
6080
- name: Send coverage results
61-
if: "matrix.coverage == 'true'"
6281
env:
6382
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
6483
GIT_COMMIT_SHA: ${{github.sha}}
@@ -74,23 +93,20 @@ jobs:
7493
mutant:
7594
name: Mutant
7695
runs-on: ubuntu-latest
96+
needs: [test, coverage]
7797
continue-on-error: true
7898
timeout-minutes: 10
7999
strategy:
80100
fail-fast: false
81101
matrix:
82-
ruby: ["2.6", "2.7", "3.0", "3.1"]
102+
ruby: ["3.0", "3.1", "3.2", "3.3", "3.4"]
83103
steps:
84-
- uses: actions/checkout@v2
104+
- uses: actions/checkout@v4
85105
with:
86106
fetch-depth: 2
87107
- name: Set up Ruby
88108
uses: ruby/setup-ruby@v1
89109
with:
90110
ruby-version: ${{matrix.ruby}}
91111
bundler-cache: true
92-
- name: Bundle install
93-
run: |
94-
gem install bundler
95-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
96112
- run: bundle exec mutant run --since HEAD~1 --zombie

.mutant.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
mutation_timeout: 1.0
33
integration: rspec
4+
usage: opensource
45
includes:
56
- lib
67
requires:

0 commit comments

Comments
 (0)