[Onboarding + Enrollments] Canonical course-format validator only
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 91/100
调研方向
阅读 supabase/schemas/dogpack/tables/enrollments.sql 中的数据库约束,并按照 docs/getting-started/first-contribution.md 中的设置指南操作。在 lib/onboarding/course_code.dart 中添加纯 Dart 函数,并在 test/course_code_test.dart 中覆盖列出的情况和输出有效性。运行 flutter test test/course_code_test.dart;当 examples 和额外情况均通过,且每个规范化后的值都符合数据库正则表达式时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
What to build
Check whether a course code already matches DogPack’s required format, such as CSCI 1301. This helper only accepts or rejects the input; the following task handles friendlier typed spellings.
Files
lib/onboarding/course_code.dart(new file)- Starting example: supabase/schemas/dogpack/tables/enrollments.sql
Code to add or extend:bool isValidCourseCode(String input).
Steps
- Add isValidCourseCode(input) using RegExp(r"^[A-Z]{4} [0-9]{4}[A-Z]?$").firstMatch(input).
- Accept only when
match.startis 0 andmatch.endequalsinput.length. This prevents a trailing newline from being accepted as a complete match. - Check CSCI 1301 and CSCI 1301L; reject lowercase, a trailing newline, the wrong number of letters/digits and extra text. This function checks the standard form without changing it.
Example
CSCI 1301/CSCI 1301L accepted; lowercase, trailing newline,3 letters,5 digits,extra text rejected.
Check it works
In test/onboarding/course_code_7_test.dart, check the example above and the failure or limit described in the steps. Run flutter test test/onboarding/course_code_7_test.dart and flutter analyze.
References
Assign yourself before starting, or comment to claim the issue. Project setup.
- 主要语言
- PLpgSQL
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DevDogsUGA/DogPack 的其他 Issue
-
polish
难度 2/5 1-3 小时 新手友好度 72/100
DevDogsUGA/DogPack#131 ·
-
polish
难度 2/5 1-3 小时 新手友好度 65/100
DevDogsUGA/DogPack#130 ·
-
moderation
难度 2/5 1-3 小时 新手友好度 75/100
DevDogsUGA/DogPack#119 ·
-
moderation
难度 2/5 1-3 小时 新手友好度 85/100
DevDogsUGA/DogPack#113 ·
-
discover
难度 2/5 1-3 小时 新手友好度 74/100
DevDogsUGA/DogPack#106 ·
查看 DevDogsUGA/DogPack 的全部 Issue
相似的 Issue
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 74/100
enorm-labs/event-junkie#3301 ·
维护者通常 1 天内回复
-
Awaiting Maintainer Approval Bug
难度 2/5 1-3 小时 新手友好度 62/100
processing/p5.js-web-editor#4364 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
one-zero-eight/apply-bot#39 ·
-
UX
难度 1/5 1 小时以内 新手友好度 72/100
mediajunkie/piper-morgan-product#2008 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复