-
Notifications
You must be signed in to change notification settings - Fork 102
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
base: main
Are you sure you want to change the base?
fix analysis issues #155
Conversation
@eldrig0 Please increase the version and add breaking changes to the Changelog (e.g. renaming enum values) |
There was a problem hiding this 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
@JsonKey(defaultValue: []) | ||
final List<TextChoice> defaultSelection; | ||
@JsonKey(defaultValue: const []) | ||
@JsonKey(defaultValue: []) |
There was a problem hiding this comment.
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.
result: $enumDecodeNullable(_$BooleanResultEnumMap, json['result']) ?? | ||
BooleanResult.NONE, | ||
BooleanResult.none, | ||
defaultValue: | ||
$enumDecodeNullable(_$BooleanResultEnumMap, json['defaultValue']), |
There was a problem hiding this comment.
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.
result: $enumDecodeNullable(_$BooleanResultEnumMap, json['result']) ?? | ||
BooleanResult.NEGATIVE, | ||
BooleanResult.negative, | ||
defaultValue: | ||
$enumDecodeNullable(_$BooleanResultEnumMap, json['defaultValue']), |
There was a problem hiding this comment.
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.
No description provided.