Enable implicit usings by Shane32 · Pull Request #631 · Shane32/QRCoder
📝 Walkthrough
Walkthrough
Enables project-level implicit/global usings via Directory.Build.props and adjusts targets for net35; removes many per-file using directives across library, payloads, demos, and tests; adds project-level Using entries for the test project and a single fully-qualified Encoder.Quality reference in PdfByteQRCode.
Changes
| Cohort / File(s) | Summary |
|---|---|
Build configurationDirectory.Build.props, Directory.Build.targets |
Enable ImplicitUsings; add global <Using> entries (BitArray alias, System.Globalization, System.Text, System.Text.RegularExpressions); conditionally Using Remove for System.Threading.Tasks when $(TargetFramework) == 'net35'. |
Core library & renderersQRCoder/..., QRCoder.Xaml/XamlQRCode.cs |
Removed numerous per-file using directives; added/kept using static QRCoder.QRCodeGenerator in noted files; qualified System.Drawing.Imaging.Encoder.Quality in QRCoder/PdfByteQRCode.cs; no API signature changes. |
QRCodeGenerator internalsQRCoder/QRCodeGenerator/* |
Removed many using directives across generator components (AlignmentPattern(s), AlphanumericEncoder, CapacityTables, CodewordBlock, GaloisField, ModulePlacer., Point, Polynom, VersionInfo, etc.); retained conditional System.Buffers where present. |
Payload generatorsQRCoder/PayloadGenerator.cs, QRCoder/PayloadGenerator/* |
Removed multiple using directives (System, System.Globalization, Linq, Text, Regex, etc.) from root and individual payload files; no functional/code-path changes. |
Exceptions & extensionsQRCoder/Exceptions/DataTooLongException.cs, QRCoder/Extensions/* |
Removed unused using directives; no API or logic changes. |
Demos & console appsQRCoderConsole/Program.cs, QRCoderDemo/*, QRCoderDemoUWP/* |
Removed unused using directives from demo/console UIs; main logic unchanged. |
Tests — per-file removalsQRCoderTests/**/* |
Removed per-file using directives (QRCoder, Shouldly, Xunit, System.*) across many tests; test source left unchanged. |
Tests — project-level usingsQRCoderTests/QRCoderTests.csproj |
Added <ItemGroup> with <Using> entries for QRCoder, QRCoderTests.Helpers, Shouldly, System.Drawing, and Xunit to provide project-wide imports for tests. |
API testsQRCoderApiTests/ApiApprovalTests.cs |
Removed using directives (System, System.IO, System.Linq); file content unchanged. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
- Review all ifdefs; add net standard 2.1 target #618 — Modifies project-level build configuration and implicit/global usings (closely related changes to Directory.Build props/targets).
- Cleanup project files; configure Directory.Build.props #628 — Edits repository-wide MSBuild configuration, overlapping with this PR’s build-file changes.
- Migrate all assertions to Shouldly syntax; use visual regression checks #624 — Changes how namespaces are provided at project-level (global/implicit using adjustments affecting tests).
Suggested reviewers
- gfoidl
- codebude
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title Check | ✅ Passed | The title “Enable implicit usings” succinctly captures the core objective of this pull request, which is to introduce implicit global using support via adjustments to Directory.Build.props and related targets. It is focused, clear, and directly reflects the most significant change without extraneous detail. A reader scanning the PR list will immediately understand the primary intent of these modifications. |
| Docstring Coverage | ✅ Passed | No functions found in the changes. Docstring coverage check skipped. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
usings
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Directory.Build.props(2 hunks)Directory.Build.targets(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- Directory.Build.props
- Directory.Build.targets
⏰ 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). (2)
- GitHub Check: build
- GitHub Check: additional-tests
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 @coderabbitai help to get the list of available commands and usage tips.