Skip to content

Commit bb72136

Browse files
authored
Merge pull request #2233 from tk0miya/fix_typo
Fix typos
2 parents 5c48490 + 8d77b95 commit bb72136

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

lib/rbs/cli.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def run_prototype(args, options)
587587
merge = true
588588
end
589589
opts.on("--todo", "Generates only undefined methods compared to objects") do
590-
Warning.warn("Geneating prototypes with `--todo` option is experimental\n", category: :experimental)
590+
Warning.warn("Generating prototypes with `--todo` option is experimental\n", category: :experimental)
591591
todo = true
592592
end
593593
opts.on("--method-owner CLASS", "Generate method prototypes if the owner of the method is [CLASS]") do |klass|
@@ -1155,15 +1155,15 @@ def run_subtract(args, _)
11551155
# Generate RBS files from the codebase.
11561156
$ rbs prototype rb lib/ > generated.rbs
11571157
1158-
# Write more descrictive types by hand.
1158+
# Write more descriptive types by hand.
11591159
$ $EDITOR handwritten.rbs
11601160
11611161
# Remove hand-written method definitions from generated.rbs.
11621162
$ rbs subtract --write generated.rbs handwritten.rbs
11631163
11641164
Options:
11651165
HELP
1166-
opts.on('-w', '--write', 'Overwrite files directry') { write_to_file = true }
1166+
opts.on('-w', '--write', 'Overwrite files directory') { write_to_file = true }
11671167
opts.on('--subtrahend=PATH', '') { |path| subtrahend_paths << path }
11681168
opts.parse!(args)
11691169
end

lib/rbs/collection/sources/rubygems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module RBS
66
module Collection
77
module Sources
8-
# Signatures that are inclduded in gem package as sig/ directory.
8+
# Signatures that are included in gem package as sig/ directory.
99
class Rubygems
1010
include Base
1111
include Singleton

lib/rbs/subtractor.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def call(minuend = @minuend, context: nil)
4040
name = absolute_typename(decl.new_name, context: context)
4141
decl unless @subtrahend.module_alias?(name) || @subtrahend.module_decl?(name)
4242
else
43-
raise "unknwon decl: #{(_ = decl).class}"
43+
raise "unknown decl: #{(_ = decl).class}"
4444
end
4545
end.compact
4646
end
@@ -51,7 +51,7 @@ def call(minuend = @minuend, context: nil)
5151
context = _ = [context, decl.name]
5252
children = call(decl.each_decl.to_a, context: context) +
5353
decl.each_member.reject { |m| member_exist?(owner, m, context: context) }
54-
children = filter_redundunt_access_modifiers(children)
54+
children = filter_redundant_access_modifiers(children)
5555
return nil if children.empty?
5656

5757
update_decl(decl, members: children)
@@ -145,7 +145,7 @@ def call(minuend = @minuend, context: nil)
145145
end
146146
end
147147

148-
private def filter_redundunt_access_modifiers(decls)
148+
private def filter_redundant_access_modifiers(decls)
149149
decls = decls.dup
150150
decls.pop while access_modifier?(decls.last)
151151
decls = decls.map.with_index do |decl, i|

lib/rbs/test/hook.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module Hook
2727
:! => "not",
2828
:<< => "lshift",
2929
:>> => "rshift",
30-
:~ => "tilda",
31-
:=~ => "eqtilda",
30+
:~ => "tilde",
31+
:=~ => "eqtilde",
3232
:% => "percent",
3333
:+@ => "unary_plus",
3434
:-@ => "unary_minus"

lib/rbs/types.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def initialize(all_fields: nil, fields: nil, location:)
536536
end
537537
end
538538
else
539-
raise ArgumentError, "only one of `:fields` or `:all_fields` is requireds"
539+
raise ArgumentError, "only one of `:fields` or `:all_fields` is required"
540540
end
541541

542542
@location = location

sig/subtractor.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module RBS
2424

2525
private def mixin_exist?: (TypeName owner, AST::Members::Include | AST::Members::Extend | AST::Members::Prepend, context: Resolver::context) -> boolish
2626

27-
private def filter_redundunt_access_modifiers: (Array[AST::Declarations::t | AST::Members::t]) -> Array[AST::Declarations::t | AST::Members::t]
27+
private def filter_redundant_access_modifiers: (Array[AST::Declarations::t | AST::Members::t]) -> Array[AST::Declarations::t | AST::Members::t]
2828

2929
private def access_modifier?: (AST::Declarations::t | AST::Members::t?) -> bool
3030

test/rbs/cli_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def stderr
1818
# Run `rbs collection` with fresh bundler environment
1919
#
2020
# You need this method to test `rbs collection` features.
21-
# `rbs collection` loads gems from Bundler context, so re-using the currenr Bundler context (used to develop rbs gem) causes issues.
21+
# `rbs collection` loads gems from Bundler context, so re-using the current Bundler context (used to develop rbs gem) causes issues.
2222
#
2323
# - If `bundler: true` is given, it runs `rbs collection` command with `bundle exec`
2424
# - If `bundler: false` is given, it runs `rbs collection` command without `bundle exec`
@@ -1127,7 +1127,7 @@ def test_prototype__runtime__todo
11271127
assert_equal <<~EOM, cli.stdout.string
11281128
EOM
11291129

1130-
assert_match Regexp.new(Regexp.escape "Geneating prototypes with `--todo` option is experimental"), cli.stderr.string
1130+
assert_match Regexp.new(Regexp.escape "Generating prototypes with `--todo` option is experimental"), cli.stderr.string
11311131
end
11321132
end
11331133
end

test/rbs/definition_builder_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,8 @@ def initialize: (String, Integer) -> void
16351635
builder = DefinitionBuilder.new(env: env)
16361636

16371637
builder.build_instance(type_name("::Hello")).tap do |definition|
1638-
initalize = definition.methods[:initialize]
1639-
assert_equal ["(::String, ::Integer) -> void"], initalize.method_types.map(&:to_s)
1638+
initialize = definition.methods[:initialize]
1639+
assert_equal ["(::String, ::Integer) -> void"], initialize.method_types.map(&:to_s)
16401640
end
16411641

16421642
builder.build_singleton(type_name("::Hello")).tap do |definition|
@@ -2687,7 +2687,7 @@ module Bar : Foo
26872687
end
26882688
end
26892689

2690-
def test_alias__to_module_self_indierect_method
2690+
def test_alias__to_module_self_indirect_method
26912691
SignatureManager.new(system_builtin: false) do |manager|
26922692
manager.add_file("foo.rbs", <<-EOF)
26932693
module Kernel

test/rbs/parser_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_module_decl_nested
225225
module Foo
226226
type foo = bar
227227
228-
BAZ: Intger
228+
BAZ: Integer
229229
end
230230
RBS
231231

@@ -733,7 +733,7 @@ def test_parse_method_type2
733733
end
734734
end
735735

736-
def test_neline_inconsitency
736+
def test_newline_inconsistency
737737
code = "module Test\r\nend"
738738

739739
RBS::Parser.parse_signature(code)

test/rbs/types_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_with_nonreturn_void?
9191

9292
[
9393
"^() -> void",
94-
"[Ineger, String]",
94+
"[Integer, String]",
9595
"Enumerator[Integer, void]"
9696
].each do |str|
9797
type = parse_type(str)

0 commit comments

Comments
 (0)