-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- `Gimei.addresses`の戻り値の型がおかしかったので直した - Romajiの型がないので必要なものだけ定義した - Array#sampleの戻り値にnilが含まれるためにエラーになっていたのをtype assertionを利用して解決した - ref: [steep/guides/src/nil-optional/nil-optional.md at master · soutaro/steep](https://github.com/soutaro/steep/blob/master/guides/src/nil-optional/nil-optional.md#handling-unwanted-nils) - 次の2つのエラーは [`steep check` uses wrong context for `#define_method` in a singleton · Issue #380 · soutaro/steep](soutaro/steep#380 - 実装側を変更することで対応した - 型のために実装を変えるのはあまりやりたくはないのだけど、define_methodよりclass_evalのほうが速いので許容した ``` lib/gimei.rb:44:13: [error] Unexpected positional argument │ Diagnostic ID: Ruby::UnexpectedPositionalArgument │ └ name(gender).public_send(method_name) ~~~~~~ lib/gimei/name.rb:19:12: [error] Unexpected positional argument │ Diagnostic ID: Ruby::UnexpectedPositionalArgument │ └ new(gender).public_send(method_name) ~~~~~~ ``` - 次の2つのエラーは特異クラスに`extend Forwardable`する方法が現状ないため無視するようにした ``` lib/gimei.rb:27:4: [error] Type `singleton(::Class)` does not have method `def_delegators` │ Diagnostic ID: Ruby::NoMethod │ └ def_delegators 'Gimei::Name', :male, :female ~~~~~~~~~~~~~~ lib/gimei.rb:28:4: [error] Type `singleton(::Class)` does not have method `def_delegators` │ Diagnostic ID: Ruby::NoMethod │ └ def_delegators :address, :prefecture, :city, :town ~~~~~~~~~~~~~~ ``` - `Gimei.names`と`@names`はsteepに期待通りに解釈させる方法が見つからなかったのでひとまずuntypedのままにしておく
- Loading branch information
Showing
9 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
D = Steep::Diagnostic | ||
|
||
target :lib do | ||
signature "sig" | ||
|
||
check "lib" | ||
|
||
library "forwardable" | ||
library "yaml" | ||
|
||
configure_code_diagnostics(D::Ruby.strict) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Romaji | ||
def self.romaji2kana: (String, Hash[Symbol, Symbol]?) -> String | ||
def self.kana2romaji: (String) -> String | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
- file: lib/gimei.rb | ||
diagnostics: | ||
- range: | ||
start: | ||
line: 27 | ||
character: 4 | ||
end: | ||
line: 27 | ||
character: 18 | ||
severity: ERROR | ||
message: Type `singleton(::Class)` does not have method `def_delegators` | ||
code: Ruby::NoMethod | ||
- range: | ||
start: | ||
line: 28 | ||
character: 4 | ||
end: | ||
line: 28 | ||
character: 18 | ||
severity: ERROR | ||
message: Type `singleton(::Class)` does not have method `def_delegators` | ||
code: Ruby::NoMethod |