fix: standardize boolean environment parsing - #718
Conversation
📝 WalkthroughWalkthroughAdds ChangesEnvironment boolean parsing
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/env.ts (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the configured
~/alias for both parser imports.Both changed imports use relative paths instead of the configured source alias.
src/env.ts#L4-L4: change the import toimport { parseEnvBoolean } from '~/utils/env';.src/tests/env.test.ts#L1-L1: change the import toimport { parseEnvBoolean } from '~/utils/env';.As per coding guidelines: use the configured
~/and@/path aliases where appropriate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/env.ts` at line 4, Replace the relative parseEnvBoolean imports with the configured ~/utils/env alias in src/env.ts (line 4) and src/tests/env.test.ts (line 1), preserving the existing imported symbol and behavior.Source: Coding guidelines
src/tests/env.test.ts (1)
3-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd nested scenario
describeblocks.Group valid values, the default fallback, and the supplied fallback under separate nested
describeblocks. Keep eachitdescription specific to its scenario.As per coding guidelines: structure tests with nested
describeblocks for the function and scenario group, and use specificitdescriptions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/tests/env.test.ts` around lines 3 - 27, Restructure the parseEnvBoolean tests by adding nested describe blocks for valid values, the default fallback, and the supplied fallback scenarios. Move each existing test into its corresponding block and make every it description specific to that scenario while preserving the current test cases and expectations.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/env.ts`:
- Line 4: Replace the relative parseEnvBoolean imports with the configured
~/utils/env alias in src/env.ts (line 4) and src/tests/env.test.ts (line 1),
preserving the existing imported symbol and behavior.
In `@src/tests/env.test.ts`:
- Around line 3-27: Restructure the parseEnvBoolean tests by adding nested
describe blocks for valid values, the default fallback, and the supplied
fallback scenarios. Move each existing test into its corresponding block and
make every it description specific to that scenario while preserving the current
test cases and expectations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 51ab05e0-f81e-4fcf-a9fc-644df9f468a5
📒 Files selected for processing (5)
next.config.jssrc/env.tssrc/server/auth.tssrc/tests/env.test.tssrc/utils/env.ts
Description
Standardizes boolean environment-variable parsing with a shared parseEnvBoolean utility.
Checklist
CONTRIBUTING.mdin its entiretySummary by CodeRabbit
Bug Fixes
true,false,1, and0are now interpreted consistently, regardless of capitalization or surrounding whitespace.Tests