Skip to content

Formart soruce - #12

Merged
winebarrel merged 1 commit into
mainfrom
fix-format
Apr 27, 2026
Merged

winebarrel merged 1 commit into
mainfrom
fix-format

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

This pull request primarily removes the Sendable protocol conformance from several data structures across the codebase, likely to simplify the model layer or address concurrency-related concerns. Additionally, there are minor code style and import order improvements for consistency and readability.

Type Model Updates:

  • Removed Sendable conformance from core data structures such as AMEDASStation, AMEDASObservation, Municipality, JMAOffice, WeatherSource, WeatherItem, and related nested types and enums across files like AMEDASService.swift, AreaHierarchyService.swift, JMAService.swift, WeatherItem.swift, and WeatherMapViewModel.swift. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Code Style and Formatting:

  • Reformatted multi-line function signatures into single lines and adjusted brace placement for several private static functions in JMAService.swift to improve readability. [1] [2] [3] [4] [5] [6] [7]
  • Improved code style in WeatherItem.swift by expanding the temperatureColor computed property to use a multi-line format.
  • Minor whitespace and import order adjustments in ContentView.swift, WeatherItem.swift, and JMAService.swift for consistency. [1] [2] [3]

Minor Logic/Consistency Fixes:

  • Added a missing line break after a property in WeatherMapViewModel.swift for clarity.
  • Simplified closure parameter style in WeatherMapViewModel.swift's buildAMEDASItems method.

Copilot AI review requested due to automatic review settings April 27, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR removes Sendable protocol conformance from several model-layer value types and applies a set of formatting/import-order cleanups across the app’s weather data and UI layers.

Changes:

  • Removed Sendable conformance from multiple structs/enums used by AMEDAS/JMA/area hierarchy and the view model.
  • Reformatted parts of JMAService (function signatures, brace placement) and adjusted some indentation/whitespace.
  • Standardized some import ordering and minor style tweaks in UI/model files.

Reviewed changes

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

Show a summary per file
File Description
TenkiMap/WeatherMapViewModel.swift Removes Sendable from MapMode, minor whitespace tweak, and closure parameter style change.
TenkiMap/WeatherItem.swift Reorders imports, removes Sendable from WeatherSource/WeatherItem, and applies small style formatting changes.
TenkiMap/JMAService.swift Removes Sendable from JMA model types and reformats several parsing/helpers and initializer formatting.
TenkiMap/ContentView.swift Adjusts import ordering.
TenkiMap/AreaHierarchyService.swift Removes Sendable from Municipality.
TenkiMap/AMEDASService.swift Removes Sendable from AMEDAS model types (including nested enum).
Comments suppressed due to low confidence (1)

TenkiMap/JMAService.swift:8

  • JMAOffice is captured into withTaskGroup { group.addTask { ... } } in fetchForecasts. addTask closures are @Sendable, so the captured values should be Sendable. Removing Sendable from JMAOffice will trigger sendability diagnostics (and can become an error under stricter concurrency settings). Consider restoring Sendable conformance for JMAOffice (or explicitly using @unchecked Sendable with justification) to keep the task-group code concurrency-safe.
struct JMAOffice {
    let code: String
    let name: String
    let latitude: Double
    let longitude: Double

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TenkiMap/JMAService.swift
Comment thread TenkiMap/JMAService.swift
Comment thread TenkiMap/JMAService.swift
Comment thread TenkiMap/JMAService.swift
@winebarrel
winebarrel merged commit eed3262 into main Apr 27, 2026
6 checks passed
@winebarrel
winebarrel deleted the fix-format branch April 27, 2026 13:36
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