Skip to content

Commit 700ed17

Browse files
First version of formatter
1 parent 28bd88c commit 700ed17

File tree

20 files changed

+265
-99
lines changed

20 files changed

+265
-99
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
reviewdog:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out code
8+
uses: actions/checkout@v1
9+
- name: rubocop
10+
uses: reviewdog/action-rubocop@v1
11+
with:
12+
github_token: ${{ secrets.github_token }}
13+
reporter: github-check
14+
rspec:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out code
18+
uses: actions/checkout@v1
19+
- name: Setup caching for ruby gems
20+
uses: actions/cache@v1
21+
with:
22+
path: vendor/bundle
23+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-gems-
26+
- name: Setup Ruby
27+
uses: actions/setup-ruby@v1
28+
with:
29+
ruby-version: 2.7
30+
- name: Install gems
31+
run: |
32+
gem install bundler:2.1.4 --no-doc
33+
bundle config path vendor/bundle
34+
bundle install --jobs 4 --retry 3
35+
- name: Run RSpec
36+
run: bundle exec rspec

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99

1010
# rspec failure tracking
1111
.rspec_status
12+
13+
# Rubymine stuff
14+
.rakeTasks

.rspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
--format documentation
21
--color
32
--require spec_helper
3+
--format RSpec::Github::Formatter

.rubocop.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
AllCops:
2+
TargetRubyVersion: 2.7
3+
4+
# A top class comment is not needed for this simple gem
5+
Style/Documentation:
6+
Enabled: false
7+
8+
# 80 chars is really short. Screens got bigger you know.
9+
Layout/LineLength:
10+
Max: 120
11+
12+
Metrics/BlockLength:
13+
Exclude:
14+
- 'spec/**/*.rb' # Specs just have large blocks
15+
- '*.gemspec' # Is just one block

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
source "https://rubygems.org"
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
24

35
# Specify your gem's dependencies in rspec-github.gemspec
46
gemspec
5-
6-
gem "rake", "~> 12.0"
7-
gem "rspec", "~> 3.0"

Gemfile.lock

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
PATH
2+
remote: .
3+
specs:
4+
rspec-github (1.0.0.develop)
5+
6+
GEM
7+
remote: https://rubygems.org/
8+
specs:
9+
ast (2.4.0)
10+
diff-lcs (1.3)
11+
jaro_winkler (1.5.4)
12+
parallel (1.19.1)
13+
parser (2.7.0.5)
14+
ast (~> 2.4.0)
15+
rainbow (3.0.0)
16+
rexml (3.2.4)
17+
rspec (3.9.0)
18+
rspec-core (~> 3.9.0)
19+
rspec-expectations (~> 3.9.0)
20+
rspec-mocks (~> 3.9.0)
21+
rspec-core (3.9.0)
22+
rspec-support (~> 3.9.0)
23+
rspec-expectations (3.9.0)
24+
diff-lcs (>= 1.2.0, < 2.0)
25+
rspec-support (~> 3.9.0)
26+
rspec-mocks (3.9.0)
27+
diff-lcs (>= 1.2.0, < 2.0)
28+
rspec-support (~> 3.9.0)
29+
rspec-support (3.9.0)
30+
rubocop (0.81.0)
31+
jaro_winkler (~> 1.5.1)
32+
parallel (~> 1.10)
33+
parser (>= 2.7.0.1)
34+
rainbow (>= 2.2.2, < 4.0)
35+
rexml
36+
ruby-progressbar (~> 1.7)
37+
unicode-display_width (>= 1.4.0, < 2.0)
38+
ruby-progressbar (1.10.1)
39+
unicode-display_width (1.6.1)
40+
41+
PLATFORMS
42+
ruby
43+
44+
DEPENDENCIES
45+
rspec (~> 3.0)
46+
rspec-github!
47+
rubocop (~> 0.81.0)
48+
49+
BUNDLED WITH
50+
2.1.4

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
# Rspec::Github
2+
[RSpec](https://rspec.info/) formatter compatible with [GitHub Action](https://github.com/features/actions)'s annotations. It supports multiline errors and will set pending specs as warnings:
23

3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rspec/github`. To experiment with that code, run `bin/console` for an interactive prompt.
4-
5-
TODO: Delete this and the text above, and describe your gem
4+
![screenshot.png](docs/screenshot.png)
65

76
## Installation
8-
9-
Add this line to your application's Gemfile:
10-
7+
Add the gem to your application's `Gemfile` `test` group:
118
```ruby
12-
gem 'rspec-github'
9+
group :test do
10+
gem 'rspec-github', require: false
11+
end
1312
```
1413

15-
And then execute:
16-
17-
$ bundle install
18-
19-
Or install it yourself as:
20-
21-
$ gem install rspec-github
14+
And then of course install the gem by executing:
15+
```shell script
16+
bundle install
17+
```
2218

2319
## Usage
20+
You can specify the formatter with a command line argument:
21+
```shell script
22+
rspec --format RSpec::Github::Formatter
23+
```
2424

25-
TODO: Write usage instructions here
25+
And to always run it with this formatter, you can set it in the `.rspec` file:
26+
```
27+
# other configuration
28+
--format RSpec::Github::Formatter
29+
```
2630

2731
## Development
32+
After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests.
33+
Publishing a new version is handled by the [publish workflow](.github/workflows/publish.yml). This workflow publishes a GitHub release to [rubygems](https://rubygems.org/) with the version defined in the release.
2834

29-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30-
31-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32-
33-
## Contributing
34-
35-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec-github.
36-
35+
### Usefull references
36+
- https://help.github.com/en/actions/reference/development-tools-for-github-actions
37+
- https://developer.github.com/apps/quickstart-guides/creating-ci-tests-with-the-checks-api
3738

3839
## License
39-
4040
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Rakefile

Lines changed: 0 additions & 6 deletions
This file was deleted.

bin/console

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)