Skip to content

Commit 06efd91

Browse files
committed
Add Steep for type checking
1 parent 5301e81 commit 06efd91

4 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/steep.yml

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

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ source "https://rubygems.org"
33
gemspec
44

55
gem "rake"
6+
gem "steep"
67
gem "test-unit"
78
gem "test-unit-ruby-core"

Rakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ Rake::TestTask.new(:test) do |t|
77
t.test_files = FileList["test/**/test_*.rb"]
88
end
99

10+
desc "Type check with Steep"
11+
task :steep do
12+
sh "steep check"
13+
end
14+
1015
task :default => :test

Steepfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
target :lib do
2+
check "lib"
3+
signature "sig"
4+
5+
library "uri"
6+
library "openssl"
7+
library "zlib"
8+
library "timeout"
9+
library "socket"
10+
library "resolv"
11+
library "strscan"
12+
library "securerandom"
13+
library "tempfile"
14+
library "cgi"
15+
16+
d = Steep::Diagnostic::Ruby.default.dup
17+
d[Steep::Diagnostic::Ruby::ArgumentTypeMismatch] = :information
18+
d[Steep::Diagnostic::Ruby::BlockTypeMismatch] = :information
19+
d[Steep::Diagnostic::Ruby::NoMethod] = :information
20+
d[Steep::Diagnostic::Ruby::UnexpectedPositionalArgument] = :information
21+
d[Steep::Diagnostic::Ruby::UnresolvedOverloading] = :information
22+
configure_code_diagnostics(d)
23+
end

0 commit comments

Comments
 (0)