specguard-rspec 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/release.yml +100 -0
- data/LICENSE +21 -0
- data/README.md +735 -0
- data/Rakefile +28 -0
- data/assets/built-with-yatfa.png +0 -0
- data/bin/specguard-lint +34 -0
- data/lib/specguard/rspec/annotation_lookup.rb +286 -0
- data/lib/specguard/rspec/annotation_scanner.rb +144 -0
- data/lib/specguard/rspec/cli.rb +466 -0
- data/lib/specguard/rspec/configuration.rb +459 -0
- data/lib/specguard/rspec/file_selector.rb +276 -0
- data/lib/specguard/rspec/finding.rb +63 -0
- data/lib/specguard/rspec/formatter.rb +919 -0
- data/lib/specguard/rspec/json_reporter.rb +163 -0
- data/lib/specguard/rspec/linter.rb +134 -0
- data/lib/specguard/rspec/payload_normalizer.rb +139 -0
- data/lib/specguard/rspec/scanner.rb +217 -0
- data/lib/specguard/rspec/schema.rb +122 -0
- data/lib/specguard/rspec/schemas/open-test-intent.v1.json +15 -0
- data/lib/specguard/rspec/transport.rb +310 -0
- data/lib/specguard/rspec/validator_backend.rb +1071 -0
- data/lib/specguard/rspec/version.rb +7 -0
- data/lib/specguard/rspec/violation_renderer.rb +372 -0
- data/lib/specguard/rspec.rb +70 -0
- data/script/bump-version.sh +115 -0
- metadata +88 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8df0db27fb3830ed9d13feb79f169746ca21b6985bc62b84a69d7285425e1cb6
|
|
4
|
+
data.tar.gz: a2e9c814cac4514eb74eda9e0ae56fafb0e6aa2bf2ff204ee5eae1fd5af92729
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 26c40b33f81916fc72014d2b96f34d65326af41583e0095c12db91759b64d742c766db8e138bc127b298002f067176ad19753d28f538c6b544d5d38fcf1dc4d1
|
|
7
|
+
data.tar.gz: 010c652c2f9ef9fc44fc5deeca844d0704da92b4cb719a35e28b85faab0456c0db4c7c16bf79a7408d8911b00dd4377bcdcc2953c5f0bff04a51de628175f2f0
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Release specguard-rspec. Triggered manually from the Actions UI ("Run
|
|
2
|
+
# workflow" button) — no tags, no push triggers. Click → run the suite → bump
|
|
3
|
+
# patch version → build the gem → push to RubyGems → publish a GitHub Release.
|
|
4
|
+
#
|
|
5
|
+
# Mirrors warden's release strategy (one-click workflow_dispatch, patch bump by
|
|
6
|
+
# script/bump-version.sh, github-actions[bot] commit, assets on the vX.Y.Z tag),
|
|
7
|
+
# with one addition that the others do not need: this repo publishes to a public
|
|
8
|
+
# package registry, and **a published gem version is immutable**. RubyGems
|
|
9
|
+
# refuses a re-push of the same number, and yanking does not free it. So the
|
|
10
|
+
# suite runs BEFORE the bump — a red build costs nothing, a bad push costs the
|
|
11
|
+
# version forever.
|
|
12
|
+
#
|
|
13
|
+
# Required repo secret:
|
|
14
|
+
# RUBYGEMS_API_KEY - an API key from rubygems.org with the "Push rubygem"
|
|
15
|
+
# scope, ideally scoped to the specguard-rspec gem.
|
|
16
|
+
name: Release (Bump Version & Publish Gem)
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
workflow_dispatch: # one-click from Actions UI; no inputs needed
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write # bump commit + vX.Y.Z tag + GitHub Release
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
release:
|
|
26
|
+
name: Test, bump, publish
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout main
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
ref: main
|
|
33
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
34
|
+
fetch-depth: 0 # full history for the rebase-and-push, and tags
|
|
35
|
+
# so bump-version.sh's tag-reuse check is real
|
|
36
|
+
|
|
37
|
+
- name: Setup Ruby
|
|
38
|
+
uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: '3.2'
|
|
41
|
+
bundler-cache: true
|
|
42
|
+
|
|
43
|
+
# Before the bump on purpose: see the header. This is the last point at
|
|
44
|
+
# which failing is free.
|
|
45
|
+
- name: Run the suite
|
|
46
|
+
run: bundle exec rspec
|
|
47
|
+
|
|
48
|
+
- name: Fail early if the publish credential is missing
|
|
49
|
+
# gem push with no credential fails AFTER the bump has been committed,
|
|
50
|
+
# tagged and pushed — leaving a released-looking tag with nothing on
|
|
51
|
+
# RubyGems. Check first; the version number is not recoverable.
|
|
52
|
+
run: |
|
|
53
|
+
if [ -z "${{ secrets.RUBYGEMS_API_KEY }}" ]; then
|
|
54
|
+
echo "::error::RUBYGEMS_API_KEY is not set — refusing to bump a version that cannot be published"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
- name: Configure Git
|
|
59
|
+
run: |
|
|
60
|
+
git config --global user.name "github-actions[bot]"
|
|
61
|
+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
62
|
+
|
|
63
|
+
- name: Bump version (commit + tag + push)
|
|
64
|
+
id: bump
|
|
65
|
+
run: |
|
|
66
|
+
# setup-ruby's bundler-cache rewrites Gemfile.lock, and the suite may
|
|
67
|
+
# leave artefacts behind; show what the tree looks like before the
|
|
68
|
+
# script's clean-tree check runs, so a refusal here is diagnosable
|
|
69
|
+
# from the log rather than only reproducible by re-running.
|
|
70
|
+
echo "--- git status ---"
|
|
71
|
+
git status --porcelain
|
|
72
|
+
echo "------------------"
|
|
73
|
+
chmod +x script/bump-version.sh
|
|
74
|
+
./script/bump-version.sh
|
|
75
|
+
|
|
76
|
+
- name: Build the gem
|
|
77
|
+
run: gem build specguard-rspec.gemspec
|
|
78
|
+
|
|
79
|
+
- name: Push to RubyGems
|
|
80
|
+
env:
|
|
81
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
82
|
+
run: gem push "specguard-rspec-${{ steps.bump.outputs.version }}.gem"
|
|
83
|
+
|
|
84
|
+
- name: Publish GitHub Release
|
|
85
|
+
env:
|
|
86
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
87
|
+
run: |
|
|
88
|
+
gh release create "${{ steps.bump.outputs.tag }}" \
|
|
89
|
+
--title "${{ steps.bump.outputs.tag }}" \
|
|
90
|
+
--notes "Published to RubyGems as \`specguard-rspec ${{ steps.bump.outputs.version }}\`.
|
|
91
|
+
|
|
92
|
+
\`\`\`ruby
|
|
93
|
+
# Gemfile
|
|
94
|
+
group :test do
|
|
95
|
+
gem \"specguard-rspec\", \"~> ${{ steps.bump.outputs.version }}\", require: false
|
|
96
|
+
end
|
|
97
|
+
\`\`\`
|
|
98
|
+
|
|
99
|
+
Two independent tools: an additive RSpec formatter that ships test-run telemetry, and \`specguard-lint\`, which validates OpenTestIntent \`@intent\` annotations." \
|
|
100
|
+
"specguard-rspec-${{ steps.bump.outputs.version }}.gem"
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 yatfa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|