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 configuration
Directory.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 & renderers
QRCoder/..., 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 internals
QRCoder/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 generators
QRCoder/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 & extensions
QRCoder/Exceptions/DataTooLongException.cs, QRCoder/Extensions/*
Removed unused using directives; no API or logic changes.
Demos & console apps
QRCoderConsole/Program.cs, QRCoderDemo/*, QRCoderDemoUWP/*
Removed unused using directives from demo/console UIs; main logic unchanged.
Tests — per-file removals
QRCoderTests/**/*
Removed per-file using directives (QRCoder, Shouldly, Xunit, System.*) across many tests; test source left unchanged.
Tests — project-level usings
QRCoderTests/QRCoderTests.csproj
Added <ItemGroup> with <Using> entries for QRCoder, QRCoderTests.Helpers, Shouldly, System.Drawing, and Xunit to provide project-wide imports for tests.
API tests
QRCoderApiTests/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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 10378e3 and 9fe64c2.

📒 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.