本次更新涵盖多个功能模块的优化与新增: 1. 新增Wi-Fi直连配对方式与协作画布模块 2. 完成设备管理重命名API与前端适配 3. 优化日签卡片空数据保护与UI细节 4. 新增剪贴板工具与每日运势会话 5. 修复应用锁恢复、语音消息录制等已知问题 6. 完善文件传输统计与配对逻辑 7. 更新安卓权限配置与iOS隐私描述 8. 新增自动化测试脚本与文档 9. 清理旧版审计报告与测试文件
96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
# ============================================================
|
|
# 闲言APP — 代码分析配置
|
|
# 创建时间: 2026-04-20
|
|
# 更新时间: 2026-04-20
|
|
# 作用: Dart/Flutter 静态分析规则
|
|
# 上次更新: Phase 0 配置
|
|
# ============================================================
|
|
|
|
# include: package:riverpod_lint/analysis_options.yaml
|
|
# 暂时注释掉,待 riverpod_lint 正确安装后再启用
|
|
|
|
analyzer:
|
|
# 排除生成的代码
|
|
exclude:
|
|
- "**/*.g.dart"
|
|
- "**/*.freezed.dart"
|
|
- "**/*.config.dart"
|
|
- "lib/gen/**"
|
|
- "packages/**"
|
|
- "docs/**"
|
|
- "docs/toolsapi/**"
|
|
- "**/*.md"
|
|
- "Scripts/**"
|
|
- "**/*.php"
|
|
plugins:
|
|
- custom_lint
|
|
|
|
errors:
|
|
# 自由化代码的警告降级
|
|
invalid_annotation_target: ignore
|
|
# 未使用的导入视为警告
|
|
unused_import: warning
|
|
# 缺少返回类型
|
|
missing_return: error
|
|
|
|
language:
|
|
strict-casts: true
|
|
strict-inference: true
|
|
strict-raw-types: true
|
|
|
|
linter:
|
|
rules:
|
|
# ---- 代码风格 ----
|
|
prefer_single_quotes: true
|
|
prefer_const_constructors: true
|
|
prefer_const_declarations: true
|
|
prefer_const_literals_to_create_immutables: true
|
|
prefer_final_fields: true
|
|
prefer_final_locals: true
|
|
prefer_final_in_for_each: true
|
|
|
|
# ---- 命名 ----
|
|
camel_case_types: true
|
|
camel_case_extensions: true
|
|
non_constant_identifier_names: true
|
|
constant_identifier_names: true
|
|
file_names: true
|
|
|
|
# ---- 代码质量 ----
|
|
avoid_print: true
|
|
avoid_empty_else: true
|
|
avoid_unnecessary_containers: true
|
|
avoid_redundant_argument_values: true
|
|
avoid_return_types_on_setters: true
|
|
avoid_types_as_parameter_names: true
|
|
empty_constructor_bodies: true
|
|
empty_catches: true
|
|
no_duplicate_case_values: true
|
|
no_leading_underscores_for_local_identifiers: true
|
|
null_check_on_nullable_type_parameter: true
|
|
prefer_is_empty: true
|
|
prefer_is_not_empty: true
|
|
prefer_is_not_operator: true
|
|
prefer_null_aware_operators: true
|
|
prefer_typing_uninitialized_variables: true
|
|
unnecessary_const: true
|
|
unnecessary_new: true
|
|
unnecessary_null_in_if_null_operators: true
|
|
unnecessary_overrides: true
|
|
unnecessary_parenthesis: true
|
|
unnecessary_string_escapes: true
|
|
unnecessary_string_interpolations: true
|
|
unnecessary_this: true
|
|
use_key_in_widget_constructors: true
|
|
sized_box_for_whitespace: true
|
|
use_build_context_synchronously: true
|
|
avoid_dynamic_calls: true
|
|
|
|
# ---- Flutter 特定 ----
|
|
use_full_hex_values_for_flutter_colors: true
|
|
prefer_void_to_null: true
|
|
|
|
# ---- 允许的例外 ----
|
|
# 代码行宽不严格限制 (依赖 formatter)
|
|
# lines_longer_than_80_chars: false
|