Skip to content

Commit 75456d2

Browse files
authored
Merge pull request #4 from dblock/misc
Misc
2 parents f799e9d + 3b0b679 commit 75456d2

File tree

19 files changed

+233
-44
lines changed

19 files changed

+233
-44
lines changed

.github/workflows/danger.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: danger
3+
on: [pull_request]
4+
jobs:
5+
danger:
6+
runs-on: ubuntu-latest
7+
env:
8+
BUNDLE_GEMFILE: Gemfile.danger
9+
steps:
10+
- uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: 2.7
17+
bundler-cache: true
18+
- name: Run Danger
19+
run: |
20+
# the personal token is public, this is ok, base64 encode to avoid tripping Github
21+
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
22+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose

.github/workflows/rubocop.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: lint
3+
on: [push, pull_request]
4+
jobs:
5+
lint:
6+
name: RuboCop
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: 3.4
14+
bundler-cache: true
15+
- name: Run RuboCop
16+
run: bundle exec rubocop

.github/workflows/test-mongodb.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: test with mongodb
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: 3.1, mongoid: 6.4.8, mongodb: 4.4 }
11+
- { ruby: 3.1, mongoid: 7.3.0, mongodb: 5.0 }
12+
- { ruby: 3.1, mongoid: 7.3.0, mongodb: 5.0 }
13+
- { ruby: 3.2, mongoid: 8.1.11, mongodb: 6.0 }
14+
- { ruby: 3.4, mongoid: 8.1.11, mongodb: 7.0 }
15+
- { ruby: 3.4, mongoid: 9.0.8, mongodb: 8.0 }
16+
name: test (ruby=${{ matrix.entry.ruby }}, mongoid=${{ matrix.entry.mongoid }}, mongodb=${{ matrix.entry.mongodb }})
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ matrix.entry.ruby }}
22+
- uses: supercharge/mongodb-github-action@1.7.0
23+
with:
24+
mongodb-version: ${{ matrix.entry.mongodb }}
25+
- name: Test
26+
run: |
27+
bundle install
28+
bundle exec rake spec
29+
env:
30+
DATABASE_ADAPTER: mongoid
31+
DATABASE_URL: "mongodb://localhost"
32+
MONGOID_VERSION: ${{ matrix.entry.mongoid }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: test with postgresql
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
entry:
10+
- { ruby: 3.1, postgresql: 11 }
11+
- { ruby: 3.1, postgresql: 14 }
12+
- { ruby: 3.1, postgresql: 14 }
13+
- { ruby: 3.2, postgresql: 15 }
14+
- { ruby: 3.3, postgresql: 16 }
15+
- { ruby: 3.4, postgresql: 17 }
16+
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }})
17+
services:
18+
postgres:
19+
image: postgres:${{ matrix.entry.postgresql }}
20+
env:
21+
POSTGRES_USER: test
22+
POSTGRES_PASSWORD: password
23+
POSTGRES_DB: slack_ruby_bot_server_events_test
24+
ports:
25+
- 5432:5432
26+
# needed because the postgres container does not provide a healthcheck
27+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
28+
steps:
29+
- uses: actions/checkout@v2
30+
- uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: ${{ matrix.entry.ruby }}
33+
- name: Test
34+
run: |
35+
bundle install
36+
bundle exec rake spec
37+
env:
38+
DATABASE_ADAPTER: activerecord
39+
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_events_test

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
AllCops:
2+
NewCops: enable
3+
14
Metrics:
25
Enabled: false
36

@@ -13,3 +16,6 @@ Style/ModuleFunction:
1316

1417
inherit_from: .rubocop_todo.yml
1518

19+
plugins:
20+
- rubocop-rake
21+
- rubocop-rspec

.rubocop_todo.yml

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,89 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2020-11-30 08:47:05 -0500 using RuboCop version 0.81.0.
3+
# on 2025-09-22 13:51:00 UTC using RuboCop version 1.80.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

99
# Offense count: 1
10-
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
10+
# Configuration parameters: Severity.
11+
Gemspec/RequiredRubyVersion:
12+
Exclude:
13+
- 'slack-ruby-bot-server-events-app-mentions.gemspec'
14+
15+
# Offense count: 1
16+
# Configuration parameters: AllowedParentClasses.
17+
Lint/MissingSuper:
18+
Exclude:
19+
- 'lib/slack-ruby-bot-server-events-app-mentions/mentions/mention.rb'
20+
21+
# Offense count: 1
22+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
23+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
1124
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
1225
Naming/FileName:
1326
Exclude:
27+
- 'Rakefile.rb'
1428
- 'lib/slack-ruby-bot-server-events-app-mentions.rb'
29+
30+
# Offense count: 1
31+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
32+
# AllowedMethods: call
33+
# WaywardPredicates: nonzero?
34+
Naming/PredicateMethod:
35+
Exclude:
36+
- 'lib/slack-ruby-bot-server-events-app-mentions/mentions/mention.rb'
37+
38+
# Offense count: 6
39+
RSpec/AnyInstance:
40+
Exclude:
41+
- 'spec/slack-ruby-bot-server-events-app-mentions/config/handlers_spec.rb'
42+
- 'spec/slack-ruby-bot-server-events-app-mentions/mentions/mention_spec.rb'
43+
- 'spec/slack-ruby-bot-server-events-app-mentions/mentions/regexp_mention_spec.rb'
44+
45+
# Offense count: 5
46+
# Configuration parameters: Prefixes, AllowedPatterns.
47+
# Prefixes: when, with, without
48+
RSpec/ContextWording:
49+
Exclude:
50+
- 'spec/slack-ruby-bot-server-events-app-mentions/config/handlers_spec.rb'
51+
52+
# Offense count: 4
53+
# This cop supports unsafe autocorrection (--autocorrect-all).
54+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
55+
# SupportedStyles: described_class, explicit
56+
RSpec/DescribedClass:
57+
Exclude:
58+
- 'spec/slack-ruby-bot-server-events-app-mentions/config/handlers_spec.rb'
59+
60+
# Offense count: 2
61+
# Configuration parameters: CountAsOne.
62+
RSpec/ExampleLength:
63+
Max: 8
64+
65+
# Offense count: 5
66+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
67+
RSpec/SpecFilePathFormat:
68+
Exclude:
69+
- '**/spec/routing/**/*'
70+
- 'spec/slack-ruby-bot-server-events-app-mentions/config/handlers_spec.rb'
71+
- 'spec/slack-ruby-bot-server-events-app-mentions/config_spec.rb'
72+
- 'spec/slack-ruby-bot-server-events-app-mentions/mentions/mention_spec.rb'
73+
- 'spec/slack-ruby-bot-server-events-app-mentions/mentions/regexp_mention_spec.rb'
74+
- 'spec/slack-ruby-bot-server-events-app-mentions/version_spec.rb'
75+
76+
# Offense count: 1
77+
# This cop supports unsafe autocorrection (--autocorrect-all).
78+
# Configuration parameters: EnforcedStyle.
79+
# SupportedStyles: always, always_true, never
80+
Style/FrozenStringLiteralComment:
81+
Exclude:
82+
- '**/*.arb'
83+
- 'spec/database_adapters/activerecord/activerecord.rb'
84+
85+
# Offense count: 1
86+
# This cop supports unsafe autocorrection (--autocorrect-all).
87+
Style/GlobalStdStream:
88+
Exclude:
89+
- 'spec/database_adapters/activerecord/activerecord.rb'

.travis.yml

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

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
### Changelog
22

3-
#### 0.1.2 (Next)
3+
#### 0.2.0 (Next)
44

5+
* [#4](https://github.com/slack-ruby/slack-ruby-bot-server-events-app-mentions/pull/4): Replaced Travis-CI with GHA - [@dblock](https://github.com/dblock).
6+
* [#4](https://github.com/slack-ruby/slack-ruby-bot-server-events-app-mentions/pull/4): Upgraded RuboCop to 1.80.2 - [@dblock](https://github.com/dblock).
57
* Your contribution here.
68

79
#### 0.1.1 (01/06/2021)

Gemfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

33
source 'https://rubygems.org'
44

5-
case ENV['DATABASE_ADAPTER']
6-
when 'mongoid' then
5+
case ENV.fetch('DATABASE_ADAPTER', nil)
6+
when 'mongoid'
77
gem 'kaminari-mongoid'
88
gem 'mongoid'
99
gem 'mongoid-scroll'
10-
when 'activerecord' then
11-
gem 'activerecord', '~> 5.0.0'
12-
gem 'otr-activerecord', '~> 1.2.1'
13-
gem 'virtus'
14-
gem 'cursor_pagination' # rubocop:disable Bundler/OrderedGems
10+
when 'activerecord'
11+
gem 'activerecord'
12+
gem 'mutex_m'
13+
gem 'otr-activerecord'
14+
gem 'pagy_cursor'
1515
gem 'pg'
16+
gem 'virtus'
1617
when nil
1718
warn "Missing ENV['DATABASE_ADAPTER']."
1819
else
19-
warn "Invalid ENV['DATABASE_ADAPTER']: #{ENV['DATABASE_ADAPTER']}."
20+
warn "Invalid ENV['DATABASE_ADAPTER']: #{ENV.fetch('DATABASE_ADAPTER', nil)}."
2021
end
2122

2223
gemspec
@@ -30,11 +31,9 @@ group :development, :test do
3031
gem 'rack-test'
3132
gem 'rake'
3233
gem 'rspec'
33-
gem 'rubocop', '0.81.0'
34+
gem 'rubocop', '1.80.2'
35+
gem 'rubocop-rake'
36+
gem 'rubocop-rspec'
3437
gem 'vcr'
3538
gem 'webmock'
3639
end
37-
38-
group :test do
39-
gem 'slack-ruby-danger', '~> 0.1.0', require: false
40-
end

Gemfile.danger

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
group :test do
4+
gem 'danger-toc', '~> 0.2.0', require: false
5+
gem 'slack-ruby-danger', '~> 0.2.0', require: false
6+
end

0 commit comments

Comments
 (0)