8000 型エラーを修正した by willnet · Pull Request #71 · willnet/gimei · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

型エラーを修正した #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025
Merged

型エラーを修正した #71

merged 1 commit into from
May 2, 2025

Conversation

willnet
Copy link
Owner
@willnet willnet commented May 2, 2025

#69 でローマ字対応を入れたときの型の対応がよくなくて、steepのバージョンアップで型チェックに失敗するようになった模様。

#69 でローマ字対応を入れたときの型の対応がよくなくて、steepのバージョンアップで型チェックに失敗するようになった模様。
@willnet willnet requested a review from Copilot May 2, 2025 01:17
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses type errors introduced when adding support for romanized names by removing inline commented type annotations, which were causing issues with the updated steep type checker.

  • Removed outdated inline type annotation comments from name and address sampling methods.
  • Updated initialization in multiple classes to ensure compatibility with steep version checks.

Reviewed Changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated 4 comments.

File Description
lib/gimei/name.rb Removed inline type comments to resolve type check errors.
lib/gimei/address.rb Removed inline type comments from prefectures, cities, and towns assignments to fix type inconsistencies.
Files not reviewed (3)
  • sig/gimei.rbs: Language not supported
  • sig/gimei/address.rbs: Language not supported
  • sig/gimei/name.rbs: Language not supported

@@ -89,7 +89,7 @@ class Last
def_delegators :@name, :kanji, :hiragana, :katakana, :to_s, :romaji

def initialize
name = Gimei.names['last_name'].sample(random: Gimei.config.rng) #: [String, String, String, String]
name = Gimei.names['last_name'].sample(random: Gimei.config.rng)
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline type comment was removed to avoid steep type check errors. If documenting expected types is still valuable, consider using a supported type annotation format or external documentation.

Copilot uses AI. Check for mistakes.

@@ -43,7 +43,7 @@ def romaji
end

def initialize
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the inline type comment resolves the type check issue; consider using standard type annotations or external documentation if type details are still needed.

Suggested change
def initialize
def initialize
# @prefectures is an array of strings representing the prefecture name in different formats:
# [kanji, hiragana, katakana, romaji]

Copilot uses AI. Check for mistakes.

@@ -67,7 +67,7 @@ def romaji
end

Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the outdated inline type comment is appropriate; ensure that any necessary type details are documented through a maintained type system or documentation.

Suggested change
# @cities: Array[String, String, String, String]
# An array containing four elements:
# - [0]: Kanji representation of the city
# - [1]: Hiragana representation of the city
# - [2]: Katakana representation of the city
# - [3]: Romaji representation of the city

Copilot uses AI. Check for mistakes.

@@ -91,7 +91,7 @@ def romaji
end

def initialize
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the inline type comment streamlines the code and addresses steep type issues. For clarity on expected types, consider adopting a supported annotation approach if needed.

Suggested change
def initialize
def initialize
# @towns is expected to be an array with at least four elements:
# [kanji (String), hiragana (String), katakana (String), romaji (String)]

Copilot uses AI. Check for mistakes.

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 47687a0 on fix-wrong-type
into 3216a26 on main.

@willnet willnet merged commit 1ed70c9 into main May 2, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0