Skip to content

fix analysis issues #155

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix analysis issues #155

wants to merge 1 commit into from

Conversation

eldrig0
Copy link

@eldrig0 eldrig0 commented Nov 22, 2024

No description provided.

@eldrig0 eldrig0 requested a review from Numoy November 22, 2024 14:42
@Numoy
Copy link
Member

Numoy commented Nov 26, 2024

@eldrig0 Please increase the version and add breaking changes to the Changelog (e.g. renaming enum values)

@eldrig0 eldrig0 requested a review from Copilot May 27, 2025 07:43
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 PR addresses JSON serialization defaults and annotations, standardizes enum casing, updates lint configurations, and inadvertently includes user-specific environment configs.

  • Standardize toJson overrides and JSON parsing (toInt, default values)
  • Rename BooleanResult enum cases to lowercase and update serializers/usage
  • Add analysis_options.yaml, remove outdated config, and update ignore rules
  • (Unintentionally) commit generated environment and local property files

Reviewed Changes

Copilot reviewed 97 out of 97 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/src/answer_format//.dart Added @override to toJson and operator, updated @JsonKey defaults
lib/src/answer_format//.g.dart Changed numeric casts to toInt() and enum mapping to lowercase
lib/src/answer_format/boolean_answer_format.dart Renamed enum cases from uppercase to lowercase
analysis_options.yaml Introduced new Flutter lints include and error overrides
ios/Flutter/flutter_export_environment.sh Updated user-specific Flutter root and build numbers
ios/Flutter/Generated.xcconfig Updated user-specific paths and version numbers
android/local.properties Updated SDK and Flutter paths to user-specific locations
Comments suppressed due to low confidence (4)

ios/Flutter/flutter_export_environment.sh:1

  • This generated environment file contains user-specific paths and should not be committed; consider adding it to .gitignore.
#!/bin/sh

ios/Flutter/Generated.xcconfig:1

  • Generated Xcode config with local paths should not be versioned; exclude or regenerate on build.
// This is a generated file; do not edit or check into version control.

lib/src/answer_format/multiple_choice_answer_format.dart:10

  • Annotation defaultValue must be a constant; revert to const [] to ensure correct default behavior.
@JsonKey(defaultValue: [])

android/local.properties:1

  • local.properties contains machine-specific SDK paths and should not be checked into source control.
sdk.dir=/Users/rinzin/Library/Android/sdk

Comment on lines +10 to +12
@JsonKey(defaultValue: [])
final List<TextChoice> defaultSelection;
@JsonKey(defaultValue: const [])
@JsonKey(defaultValue: [])
Copy link
Preview

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Annotation defaultValue expects a compile-time constant; use const [] instead of mutable [] to avoid unexpected runtime behavior.

Copilot uses AI. Check for mistakes.

Comment on lines 13 to 16
result: $enumDecodeNullable(_$BooleanResultEnumMap, json['result']) ??
BooleanResult.NONE,
BooleanResult.none,
defaultValue:
$enumDecodeNullable(_$BooleanResultEnumMap, json['defaultValue']),
Copy link
Preview

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Changing enum serialization from uppercase to lowercase will break existing JSON consumers; consider supporting both cases or versioning the API.

Copilot uses AI. Check for mistakes.

Comment on lines 12 to 15
result: $enumDecodeNullable(_$BooleanResultEnumMap, json['result']) ??
BooleanResult.NEGATIVE,
BooleanResult.negative,
defaultValue:
$enumDecodeNullable(_$BooleanResultEnumMap, json['defaultValue']),
Copy link
Preview

Copilot AI May 27, 2025

Choose a reason for hiding this comment

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

Lowercasing enum values in JSON mapping alters the contract with existing data; ensure backward compatibility or document the change.

Copilot uses AI. Check for mistakes.

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