Conversation
WalkthroughExpanded the ABC_LIKE contest prefix set in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/lib/utils/contest.ts (3)
98-98: Unify Tenka1 Beginner display names (include years for consistency)Two entries omit the year while 2019 includes it. Suggest adding years for 2017/2018 to keep labels consistent.
Apply this diff:
- 'tenka1-2017-beginner': 'Tenka1 Programmer Beginner Contest', + 'tenka1-2017-beginner': 'Tenka1 Programmer Beginner Contest 2017', ... - 'tenka1-2018-beginner': 'Tenka1 Programmer Beginner Contest', + 'tenka1-2018-beginner': 'Tenka1 Programmer Beginner Contest 2018',Also applies to: 102-102, 105-105
322-389: Consider surfacing official labels for ABC_LIKE in getContestNameLabelCurrently ABC_LIKE contests fall back to
contestId.toUpperCase(). Since you already maintainABC_LIKEwith official names, you can use it to improve UX.Add a branch before the final fallback:
// Prefer official display names for ABC_LIKE contests if (abcLikePrefixes.has(contestId)) { return (ABC_LIKE as Record<string, string>)[contestId] ?? contestId.toUpperCase(); }If you want to avoid casting, a tiny helper works:
function getLabelFromMap(map: Record<string, string>, key: string) { return Object.prototype.hasOwnProperty.call(map, key) ? map[key] : undefined; }Then:
const label = getLabelFromMap(ABC_LIKE, contestId); if (label) return label;
303-304: Anchor the Axc regex to avoid partial matches
regexForAxccan match prefixes of longer strings (e.g.,abc123x). Anchoring to end eliminates false positives in label generation.Apply this diff:
-const regexForAxc = /^(abc|arc|agc)(\d{3})/i; +const regexForAxc = /^(abc|arc|agc)(\d{3})$/i;Please ensure this doesn’t affect any existing label cases beyond the intended ones (tests for ABC/ARC/AGC should still pass).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
src/lib/utils/contest.ts(1 hunks)src/test/lib/utils/test_cases/contest_type.ts(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: preview
🔇 Additional comments (2)
src/lib/utils/contest.ts (1)
98-113: Expanded ABC_LIKE prefixes: looks goodNew prefixes align with the import targets in the PR objective and match AtCoder IDs. Classification order preserves expected precedence.
Please confirm there’s no overlap with ARC_LIKE/OTHERS by running the test suite; if you want, I can generate a quick script to diff the key sets and check for collisions.
src/test/lib/utils/test_cases/contest_type.ts (1)
190-221: New ABC_LIKE classification tests: looks goodCoverage aligns with the newly added prefixes and keeps expectations consistent.
Also applies to: 230-233, 242-245
close #2617
Summary by CodeRabbit
New Features
Tests