Skip to content

Commit 4909a71

Browse files
committed
fix typing
1 parent a55f8ff commit 4909a71

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ source 'https://rubygems.org'
66
gemspec
77

88
gem 'rake', '~> 13'
9+
gem 'rbs', require: false
910
gem 'rspec', '~> 3'
1011
gem 'rubocop', '~> 1'
1112
gem 'rubocop-performance', '~> 1.26'

Rakefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
require 'bundler/gem_tasks'
44
require 'rspec/core/rake_task'
5-
6-
RSpec::Core::RakeTask.new(:spec)
7-
85
require 'rubocop/rake_task'
96

7+
RSpec::Core::RakeTask.new(:spec)
108
RuboCop::RakeTask.new
119

12-
task default: %i[rubocop spec]
10+
desc 'Validate RBS files'
11+
task :rbs_validate do
12+
sh 'bundle exec rbs -I sig -r json -r strscan validate'
13+
end
14+
15+
task default: %i[rbs_validate rubocop spec]

sig/json_mend.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module JsonMend
22
VERSION: String
33

4-
type _JSONValue = String | Integer | Float | bool | nil | Array[_JSONValue] | Hash[String, _JSONValue]
4+
type json_value = String | Integer | Float | bool | nil | Array[json_value] | Hash[String, json_value]
55

6-
def self.repair: (String, ?return_objects: bool) -> String | _JSONValue | nil
6+
def self.repair: (String, ?return_objects: bool) -> (String | json_value | nil)
77
end

sig/manifest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies:
2+
- name: json
3+
- name: strscan

0 commit comments

Comments
 (0)