Conversation
Changes: 1. Removed duplicate Console.OutputEncoding/InputEncoding from Application.cs - Encoding is already set in Program.cs bootstrap before DI - Application.cs should use IConsoleService for console operations 2. Replaced Service Locator pattern with constructor injection - Inject IEnvironmentService directly instead of via IServiceProvider - Application now receives all dependencies through constructor - Improves testability and follows DI best practices Refs: #129 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
martincjarvis
left a comment
There was a problem hiding this comment.
LGTM! Good refactoring:
-
Duplicate encoding removal - Correctly identified that Console encoding was set twice. Keeping it in Program.cs bootstrap is appropriate since encoding must be set before any console output.
-
Service Locator elimination - Injecting IEnvironmentService directly through the constructor follows DI best practices and improves testability. The test updates correctly reflect the new pattern.
Changes are minimal, focused, and tests pass.
No Plan File DetectedThis PR does not modify any plan files. If this work is tracked by a plan, please update the relevant plan file in |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
## Summary
- Add `--fail-on-errors` flag to `danger ci` command in workflow
- Without this flag, workflow passes even when Danger finds rule
violations
## Problem
Two separate checks were created:
1. **Check Run** ("Danger PR Validation") - Always passed if workflow
completed
2. **Status Context** ("Danger") - Showed actual failures
This allowed PR #130 to merge despite Danger showing failures.
## Fix
```diff
- run: npx danger ci
+ run: npx danger ci --fail-on-errors
```
Now the workflow will fail when Danger finds issues, blocking the merge.
Closes: #131
## Test Plan
- [x] Verify workflow syntax is valid
- [ ] Test on a PR with Danger violations to confirm it blocks merge
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Changes
Application.cs: Removed duplicate encoding calls, removed IServiceProvider dependency, inject IEnvironmentService directlyProgramTests.cs: Updated to use direct IEnvironmentService mock instead of IServiceProviderCloses #129
Test Plan
🤖 Generated with Claude Code