Skip to content

chore(style): enforce file-scoped namespaces and PascalCase public members at build time - #703

Merged
tylerkron merged 4 commits into
mainfrom
chore/484-editorconfig-style-enforcement
Aug 29, 2026
Merged

tylerkron merged 4 commits into
mainfrom
chore/484-editorconfig-style-enforcement

Conversation

@tylerkron

Copy link
Copy Markdown
Contributor

What was wrong

Nothing checked code style, in a repo that otherwise treats every warning as an error. Namespace
style had split roughly down the middle — about 200 files file-scoped against 142 block-scoped —
because a new file copied whichever style the file next to it happened to use, and nothing ever
said which was right. And two constants had shipped on the public NuGet package spelled
DEFAULT_BEGIN_PROTECTED_ADDRESS / DEFAULT_END_PROTECTED_ADDRESS, a style that appears nowhere
else on the public surface and that gets more expensive to correct with every release.

The docs also told readers to call ScpiMessageProducer.TurnDeviceOff. That member has never
existed — only TurnDeviceOn — so anyone copying that snippet got a compile error.

How it was fixed

Two rules now fail the build rather than waiting for someone to catch them in review: IDE0161
(file-scoped namespaces, repo-wide) and CA1707 (no underscores in public member names, scoped
to Daqifi.Core). EnforceCodeStyleInBuild in Directory.Build.props is what makes them run
outside an editor. The two constants are renamed to DefaultBeginProtectedAddress /
DefaultEndProtectedAddress, with [Obsolete] forwarders so source written against the released
package still compiles — the source compatibility ADR 0002 promises. The 142 block-scoped
namespaces are converted, and the bad doc line is gone.

Three things worth pushing back on:

  • CA1707 is left at its default public-only api_surface. Widening it to all sounds
    stricter and is wrong here: it also reports private static fields written in this repo's own
    _camelCase convention (SdCardFileParserFactory._supportedExtensions). Eight private
    SCREAMING_SNAKE constants therefore survive. They cost nothing outside the assembly, and
    renaming them under a rule that would not police them afterwards is churn, not enforcement.
  • The namespace sweep is a 100-file, 27k-line diff. It is one commit (9b196ae), produced by
    dotnet format style --diagnostics IDE0161, and the way to read it is git diff -w: ignoring
    whitespace it is 201 insertions and 300 deletions — the namespace line, its opening brace and
    its closing brace, per file, and nothing else. I checked that mechanically: with -w there is
    not a single changed line that is not one of those three.
  • Only one new test came out of the constant rename. Two more were written and dropped for
    failing this repo's bar that a guard must be able to fail on a green build:
    PublicAPI.Shipped.txt records a public const by value, so a forwarder drifting from its
    replacement, or a literal changing, already fails RS0016/RS0017. [Obsolete] is not recorded
    there, so that is the one thing left worth asserting.

Verified

  • dotnet test Daqifi.Core.sln -warnaserror green on both frameworks: 4139 passed / 3 skipped
    (net9.0 and net10.0), plus 217 Daqifi.Mcp tests on each.
  • Both rules were positive-controlled. A new public const int SOME_VALUE in Daqifi.Core
    fails CA1707; a new block-scoped namespace in the test project fails IDE0161.
  • Every new test was mutation-tested and confirmed to fail on a green build: removing
    EnforceCodeStyleInBuild, setting IDE0161 to none, setting CA1707 to none, and dropping
    [Obsolete] from a forwarder each leave 0 Error(s) and turn a test red.
  • Source compatibility checked directly, not assumed: a scratch project referencing the old
    DEFAULT_* names compiles against this branch, with CS0618 naming the replacement.
  • Bench, Nq1 fw 3.7.2 on /dev/cu.usbmodem1101: connect → status (analogIn=16, digital=16) →
    AI0/AI1 → 100 Hz → 3 s CSV capture (236 rows) → clean disconnect, exit 0. Non-destructive. The
    ~79% effective rate is the known fw 3.7.2 clock mismatch, not a change from this PR.

closes #484

…mbers at build time

Adds the two style rules the repo had been relying on habit for, and wires
EnforceCodeStyleInBuild so they run in `dotnet build` (and therefore CI) rather
than only as editor squiggles.

IDE0161 (file-scoped namespaces) is repo-wide; CA1707 (no underscores in public
member names) is scoped to Daqifi.Core, the only project that publishes a public
surface, and left at its default public-only api_surface so it does not fight
the repo's own _camelCase private-field convention.

CA1707's only two hits were IntelHexParser's shipped constants, renamed to
DefaultBeginProtectedAddress / DefaultEndProtectedAddress with [Obsolete]
forwarders that keep the old spellings compiling, per ADR 0002.

Also drops the ScpiMessageProducer.TurnDeviceOff line from DEVICE_INTERFACES.md
- that member has never existed, so the snippet did not compile.

Refs #484
…coped

Mechanical, produced by `dotnet format style Daqifi.Core.sln --diagnostics
IDE0161`. Reviewable as `git diff -w`: ignoring whitespace the change is 100
files, 201 insertions and 300 deletions - the namespace line, its opening brace,
and its closing brace, and nothing else. The rest of each file's diff is the
one-level dedent.

Refs #484
…rwarders

The analyzers are the real guard; what they cannot guard is their own wiring.
Dropping EnforceCodeStyleInBuild, or setting either severity to none, leaves the
build green with the style unpoliced - so CodeStyleEnforcementTests asserts both.
Each was mutation-tested: build green, test red.

IntelHexParserTests gains one case, that the two shipped SCREAMING_SNAKE names
are still public and still carry [Obsolete]. Two further candidates - the
forwarders equalling their replacements, and the constants keeping their shipped
literals - were written, mutation-tested, and dropped: PublicAPI.Shipped.txt
records a public const by value, so both mutations already fail RS0016/RS0017
rather than passing a green build.

Also documents both rules in CONTRIBUTING.md next to the existing CA2007 and
PublicAPI sections.

Refs #484
@tylerkron
tylerkron requested a review from a team as a code owner August 28, 2026 20:53
@tylerkron

Copy link
Copy Markdown
Contributor Author

/agentic_review

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Enforce namespace and public member naming during builds

⚙️ Configuration changes ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Enforce file-scoped namespaces and PascalCase public APIs as build-breaking analyzer rules.
• Convert legacy namespaces and preserve renamed constants through obsolete compatibility aliases.
• Add enforcement guards, contributor guidance, and remove an invalid device-command example.
Diagram

graph TD
  Config["Style config"] --> Build["dotnet build"] --> Analyzers["Style analyzers"]
  Analyzers --> Namespaces["File namespaces"]
  Analyzers --> PublicApi["Public API"] --> Aliases["Obsolete aliases"]
  Guards["Guard tests"] --> Build
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Defer API rename to a major release
  • ➕ Avoids obsolete aliases on the current public surface
  • ➕ Allows removal and renaming in one breaking release
  • ➖ Leaves inconsistent public names indefinitely
  • ➖ Weakens immediate CA1707 enforcement or requires permanent suppressions
2. Use a separate CI formatting check
  • ➕ Keeps style validation isolated from normal compilation
  • ➕ Can report formatting drift as a dedicated job
  • ➖ Adds another workflow developers must reproduce
  • ➖ Does not guarantee every local build applies the policy

Recommendation: Keep the PR's approach: build-integrated analyzers make policy universal, and obsolete forwarding constants satisfy current source-compatibility commitments while guiding consumers toward compliant names. A dedicated formatting job adds operational complexity, while postponing the rename allows further public API debt.

Files changed (106) +11681 / -11507

Bug fix (1) +30 / -3
IntelHexParser.csRename protected-address constants with compatibility aliases +30/-3

Rename protected-address constants with compatibility aliases

• Adds PascalCase public constants, updates default construction to use them, and retains the shipped underscore names as obsolete CA1707-suppressed forwarders.

src/Daqifi.Core/Firmware/IntelHexParser.cs

Refactor (98) +11449 / -11503
AnalogOutputChannelTests.csConvert channel tests to a file-scoped namespace +179/-180

Convert channel tests to a file-scoped namespace

• Mechanically replaces the block-scoped namespace and dedents the unchanged test body.

src/Daqifi.Core.Tests/Channel/AnalogOutputChannelTests.cs

AcquisitionStatisticsTests.csConvert acquisition statistics tests to file scope +730/-731

Convert acquisition statistics tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/AcquisitionStatisticsTests.cs

DaqifiDeviceDrainErrorQueueTests.csConvert error queue tests to file scope +183/-184

Convert error queue tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiDeviceDrainErrorQueueTests.cs

DaqifiDeviceFirmwareSupportTests.csConvert firmware support tests to file scope +54/-55

Convert firmware support tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiDeviceFirmwareSupportTests.cs

DaqifiDeviceInitializeTests.csConvert initialization tests to file scope +1009/-1010

Convert initialization tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DaqifiDeviceInitializeTests.cs

DaqifiDeviceLoggerTests.csConvert logger tests to file scope +73/-74

Convert logger tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiDeviceLoggerTests.cs

DaqifiDeviceTests.csConvert device tests to file scope +233/-234

Convert device tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiDeviceTests.cs

DaqifiDeviceTextCommandLockTests.csConvert command lock tests to file scope +107/-108

Convert command lock tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiDeviceTextCommandLockTests.cs

DaqifiStreamingDeviceAnalogOutputTests.csConvert analog output tests to file scope +468/-469

Convert analog output tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceAnalogOutputTests.cs

DaqifiStreamingDeviceAsyncSurfaceTests.csConvert async surface tests to file scope +334/-335

Convert async surface tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceAsyncSurfaceTests.cs

DaqifiStreamingDeviceChannelManagementTests.csConvert channel management tests to file scope +717/-718

Convert channel management tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceChannelManagementTests.cs

DaqifiStreamingDeviceFriendlyNameTests.csConvert friendly-name tests to file scope +67/-68

Convert friendly-name tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceFriendlyNameTests.cs

DaqifiStreamingDeviceLiveStreamTerminationTests.csConvert stream termination tests to file scope +288/-289

Convert stream termination tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceLiveStreamTerminationTests.cs

DaqifiStreamingDeviceLiveStreamTests.csConvert live-stream tests to file scope +194/-195

Convert live-stream tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceLiveStreamTests.cs

DaqifiStreamingDevicePwmFrequencyTests.csConvert PWM frequency tests to file scope +125/-126

Convert PWM frequency tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDevicePwmFrequencyTests.cs

DaqifiStreamingDeviceTests.csConvert streaming device tests to file scope +273/-274

Convert streaming device tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DaqifiStreamingDeviceTests.cs

DeviceFeatureSupportTests.csConvert feature support tests to file scope +273/-274

Convert feature support tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/DeviceFeatureSupportTests.cs

DeviceNotConnectedExceptionTests.csConvert connection exception tests to file scope +284/-285

Convert connection exception tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/DeviceNotConnectedExceptionTests.cs

AllTransportsDeviceFinderTests.csConvert discovery tests to file scope +311/-312

Convert discovery tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/Discovery/AllTransportsDeviceFinderTests.cs

FeatureNotSupportedExceptionTests.csConvert feature exception tests to file scope +54/-55

Convert feature exception tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/FeatureNotSupportedExceptionTests.cs

NetworkConfigurableTests.csConvert network configurability tests to file scope +692/-693

Convert network configurability tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/Network/NetworkConfigurableTests.cs

NetworkConfigurationTests.csConvert network configuration tests to file scope +158/-159

Convert network configuration tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/Network/NetworkConfigurationTests.cs

ScpiResponseClassifierTests.csConvert SCPI classifier tests to file scope +144/-145

Convert SCPI classifier tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/ScpiResponseClassifierTests.cs

SdCardCaptureEstimateTests.csConvert capture estimate tests to file scope +55/-56

Convert capture estimate tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/SdCard/SdCardCaptureEstimateTests.cs

SdCardFileInfoTests.csConvert SD-card file info tests to file scope +41/-42

Convert SD-card file info tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/SdCard/SdCardFileInfoTests.cs

SdCardFileListParserTests.csConvert file-list parser tests to file scope +418/-419

Convert file-list parser tests to file scope

• Mechanically replaces the block-scoped namespace and dedents unchanged tests.

src/Daqifi.Core.Tests/Device/SdCard/SdCardFileListParserTests.cs

SdCardSpaceCheckTests.csConvert SD-card space tests to file scope +123/-124

Convert SD-card space tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/SdCard/SdCardSpaceCheckTests.cs

TimestampGapDetectorTests.csConvert timestamp gap tests to file scope +179/-180

Convert timestamp gap tests to file scope

• Mechanically converts the namespace declaration without changing test behavior.

src/Daqifi.Core.Tests/Device/TimestampGapDetectorTests.cs

LiveSample.csConvert LiveSample to a file-scoped namespace +12/-13

Convert LiveSample to a file-scoped namespace

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Channel/LiveSample.cs

AcquisitionStatistics.csConvert AcquisitionStatistics to file scope +502/-503

Convert AcquisitionStatistics to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/AcquisitionStatistics.cs

AcquisitionStatisticsSnapshot.csConvert statistics snapshots to file scope +54/-55

Convert statistics snapshots to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/AcquisitionStatisticsSnapshot.cs

ChannelAcquisitionStatistics.csConvert channel statistics to file scope +157/-158

Convert channel statistics to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/ChannelAcquisitionStatistics.cs

ChannelsPopulatedEventArgs.csConvert channel event arguments to file scope +27/-28

Convert channel event arguments to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/ChannelsPopulatedEventArgs.cs

ConnectionStatus.csConvert connection status to file scope +35/-36

Convert connection status to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/ConnectionStatus.cs

DaqifiStreamingDevice.csConvert streaming device implementation to file scope +1175/-1176

Convert streaming device implementation to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/DaqifiStreamingDevice.cs

DeviceCommandFailedException.csConvert command exception to file scope +108/-109

Convert command exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/DeviceCommandFailedException.cs

DeviceFeature.csConvert device features to file scope +38/-39

Convert device features to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/DeviceFeature.cs

DeviceFeatureRequirements.csConvert feature requirements to file scope +113/-114

Convert feature requirements to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/DeviceFeatureRequirements.cs

DeviceNotConnectedException.csConvert connection exception to file scope +109/-110

Convert connection exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/DeviceNotConnectedException.cs

DeviceStatusEventArgs.csConvert status event arguments to file scope +16/-17

Convert status event arguments to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/DeviceStatusEventArgs.cs

DeviceDiagnosticsCorruptedResponseException.csConvert corrupted-response exception to file scope +28/-29

Convert corrupted-response exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Diagnostics/DeviceDiagnosticsCorruptedResponseException.cs

DeviceDiagnosticsException.csConvert diagnostics exception to file scope +21/-22

Convert diagnostics exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Diagnostics/DeviceDiagnosticsException.cs

DeviceDiagnosticsOperations.csConvert diagnostics operations to file scope +261/-262

Convert diagnostics operations to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/Diagnostics/DeviceDiagnosticsOperations.cs

IDeviceDiagnostics.csConvert diagnostics interface to file scope +96/-97

Convert diagnostics interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/Diagnostics/IDeviceDiagnostics.cs

AllTransportsDeviceFinder.csConvert transport discovery to file scope +215/-216

Convert transport discovery to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/Discovery/AllTransportsDeviceFinder.cs

FeatureNotSupportedException.csConvert feature exception to file scope +63/-64

Convert feature exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/FeatureNotSupportedException.cs

IConfirmingDeviceAdministration.csConvert administration interface to file scope +156/-157

Convert administration interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/IConfirmingDeviceAdministration.cs

IDevice.csConvert device interface to file scope +100/-101

Convert device interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/IDevice.cs

ILiveSampleSource.csConvert live sample interface to file scope +0/-0

Convert live sample interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/ILiveSampleSource.cs

IStreamingDevice.csConvert streaming interface to file scope +0/-0

Convert streaming interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/IStreamingDevice.cs

ChannelControlOperations.csConvert channel operations to file scope +0/-0

Convert channel operations to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/ChannelControlOperations.cs

ConnectionGuard.csConvert connection guard to file scope +0/-0

Convert connection guard to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/ConnectionGuard.cs

DeviceAdministrationOperations.csConvert administration operations to file scope +0/-0

Convert administration operations to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/DeviceAdministrationOperations.cs

IDeviceOperationHost.csConvert operation host interface to file scope +0/-0

Convert operation host interface to file scope

• Mechanically converts the namespace declaration without changing the internal contract.

src/Daqifi.Core/Device/Internal/IDeviceOperationHost.cs

IOperationSerializationHost.csConvert serialization host interface to file scope +0/-0

Convert serialization host interface to file scope

• Mechanically converts the namespace declaration without changing the internal contract.

src/Daqifi.Core/Device/Internal/IOperationSerializationHost.cs

ITextExchangeHost.csConvert text exchange host to file scope +0/-0

Convert text exchange host to file scope

• Mechanically converts the namespace declaration without changing the internal contract.

src/Daqifi.Core/Device/Internal/ITextExchangeHost.cs

LifecycleGate.csConvert lifecycle gate to file scope +0/-0

Convert lifecycle gate to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/LifecycleGate.cs

LiveSampleStream.csConvert live sample stream to file scope +0/-0

Convert live sample stream to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/LiveSampleStream.cs

OperationSerializer.csConvert operation serializer to file scope +0/-0

Convert operation serializer to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/OperationSerializer.cs

OutboundWriterSample.csConvert outbound sample model to file scope +0/-0

Convert outbound sample model to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/OutboundWriterSample.cs

SessionCommandInterpreter.csConvert command interpreter to file scope +0/-0

Convert command interpreter to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/SessionCommandInterpreter.cs

StatusChannelPopulator.csConvert channel populator to file scope +0/-0

Convert channel populator to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/StatusChannelPopulator.cs

StreamFrameDecoder.csConvert frame decoder to file scope +0/-0

Convert frame decoder to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/StreamFrameDecoder.cs

StreamFrameGate.csConvert frame gate to file scope +0/-0

Convert frame gate to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/StreamFrameGate.cs

StreamingSessionSnapshot.csConvert session snapshots to file scope +0/-0

Convert session snapshots to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/StreamingSessionSnapshot.cs

TextExchangeEngine.csConvert text exchange engine to file scope +0/-0

Convert text exchange engine to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/Internal/TextExchangeEngine.cs

UsbStreamInterfaceInitializer.csConvert USB initializer to file scope +0/-0

Convert USB initializer to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Internal/UsbStreamInterfaceInitializer.cs

LanChipInfoOperations.csConvert LAN operations to file scope +0/-0

Convert LAN operations to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/LanChipInfoOperations.cs

MessageReceivedEventArgs.csConvert message event arguments to file scope +0/-0

Convert message event arguments to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/MessageReceivedEventArgs.cs

INetworkConfigurable.csConvert network interface to file scope +0/-0

Convert network interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/Network/INetworkConfigurable.cs

NetworkConfiguration.csConvert network configuration to file scope +0/-0

Convert network configuration to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Network/NetworkConfiguration.cs

NetworkConfigurationOperations.csConvert network operations to file scope +0/-0

Convert network operations to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Network/NetworkConfigurationOperations.cs

WifiMode.csConvert Wi-Fi mode to file scope +0/-0

Convert Wi-Fi mode to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Network/WifiMode.cs

WifiSecurityType.csConvert Wi-Fi security type to file scope +0/-0

Convert Wi-Fi security type to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/Network/WifiSecurityType.cs

ScpiInitializationErrorException.csConvert SCPI initialization exception to file scope +0/-0

Convert SCPI initialization exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/ScpiInitializationErrorException.cs

ScpiResponseClassifier.csConvert SCPI classifier to file scope +0/-0

Convert SCPI classifier to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/ScpiResponseClassifier.cs

ISdCardOperationHost.csConvert SD-card host interface to file scope +0/-0

Convert SD-card host interface to file scope

• Mechanically converts the namespace declaration without changing the internal contract.

src/Daqifi.Core/Device/SdCard/ISdCardOperationHost.cs

ISdCardOperations.csConvert SD-card operations interface to file scope +0/-0

Convert SD-card operations interface to file scope

• Mechanically converts the namespace declaration without changing the public contract.

src/Daqifi.Core/Device/SdCard/ISdCardOperations.cs

SdCardBusyException.csConvert busy exception to file scope +0/-0

Convert busy exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardBusyException.cs

SdCardDirectoryNotFoundException.csConvert directory exception to file scope +0/-0

Convert directory exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardDirectoryNotFoundException.cs

SdCardEmptyTransferException.csConvert empty-transfer exception to file scope +0/-0

Convert empty-transfer exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardEmptyTransferException.cs

SdCardFileInfo.csConvert SD-card file info to file scope +0/-0

Convert SD-card file info to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardFileInfo.cs

SdCardFileListParser.csConvert file-list parser to file scope +0/-0

Convert file-list parser to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardFileListParser.cs

SdCardFilesystemException.csConvert filesystem exception to file scope +0/-0

Convert filesystem exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardFilesystemException.cs

SdCardListIncompleteException.csConvert incomplete-list exception to file scope +0/-0

Convert incomplete-list exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardListIncompleteException.cs

SdCardListingStatus.csConvert listing status to file scope +0/-0

Convert listing status to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardListingStatus.cs

SdCardLogFormat.csConvert log format to file scope +0/-0

Convert log format to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardLogFormat.cs

SdCardLoggingSession.csConvert logging session to file scope +0/-0

Convert logging session to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardLoggingSession.cs

SdCardNotPresentException.csConvert card-presence exception to file scope +0/-0

Convert card-presence exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardNotPresentException.cs

SdCardOperationException.csConvert operation exception to file scope +0/-0

Convert operation exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardOperationException.cs

SdCardOperations.csConvert SD-card operations to file scope +0/-0

Convert SD-card operations to file scope

• Mechanically replaces the block-scoped namespace and dedents the unchanged implementation.

src/Daqifi.Core/Device/SdCard/SdCardOperations.cs

SdCardTransferStallReason.csConvert stall reason to file scope +0/-0

Convert stall reason to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardTransferStallReason.cs

SdCardTransferStalledException.csConvert stalled-transfer exception to file scope +95/-96

Convert stalled-transfer exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardTransferStalledException.cs

SdCardTruncatedTransferException.csConvert truncated-transfer exception to file scope +72/-73

Convert truncated-transfer exception to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/SdCard/SdCardTruncatedTransferException.cs

StreamFrameDiscardReason.csConvert discard reason to file scope +43/-44

Convert discard reason to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/StreamFrameDiscardReason.cs

StreamFrameDiscardedEventArgs.csConvert discard event arguments to file scope +45/-46

Convert discard event arguments to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/StreamFrameDiscardedEventArgs.cs

TimestampGapDetector.csConvert timestamp detector to file scope +112/-113

Convert timestamp detector to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/TimestampGapDetector.cs

TimestampGapEventArgs.csConvert timestamp event arguments to file scope +30/-31

Convert timestamp event arguments to file scope

• Mechanically converts the namespace declaration without changing runtime behavior.

src/Daqifi.Core/Device/TimestampGapEventArgs.cs

Tests (2) +139 / -0
CodeStyleEnforcementTests.csGuard build-time style enforcement wiring +104/-0

Guard build-time style enforcement wiring

• Adds tests that require EnforceCodeStyleInBuild and build-failing severities for IDE0161 and CA1707.

src/Daqifi.Core.Tests/Build/CodeStyleEnforcementTests.cs

IntelHexParserTests.csTest legacy constant obsoletion contracts +35/-0

Test legacy constant obsoletion contracts

• Verifies the shipped protected-address constant names remain public and carry Obsolete annotations directing consumers to replacements.

src/Daqifi.Core.Tests/Firmware/IntelHexParserTests.cs

Documentation (2) +20 / -1
CONTRIBUTING.mdDocument enforced code-style policies +20/-0

Document enforced code-style policies

• Explains the analyzer rules, bulk namespace conversion command, and compatibility expectations for public API renames.

CONTRIBUTING.md

DEVICE_INTERFACES.mdRemove nonexistent device-off command example +0/-1

Remove nonexistent device-off command example

• Deletes the invalid ScpiMessageProducer.TurnDeviceOff usage from the device command snippet.

docs/DEVICE_INTERFACES.md

Other (3) +43 / -0
.editorconfigConfigure build-failing namespace and public naming rules +33/-0

Configure build-failing namespace and public naming rules

• Enables IDE0161 for all C# files and CA1707 for Daqifi.Core's public surface, with rationale for their scopes and severities.

.editorconfig

Directory.Build.propsRun code-style analyzers during builds +8/-0

Run code-style analyzers during builds

• Sets EnforceCodeStyleInBuild so editor-style diagnostics execute in local and CI builds and become errors under the existing warning policy.

Directory.Build.props

PublicAPI.Unshipped.txtRecord new PascalCase constants in the API baseline +2/-0

Record new PascalCase constants in the API baseline

• Adds the two replacement IntelHexParser constants and their values to the unshipped public API contract.

src/Daqifi.Core/PublicAPI.Unshipped.txt

@qodo-code-review

qodo-code-review Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 4f71f20 ⚖️ Balanced

Results up to commit f767eb6 ⚖️ Balanced


No changes from previous review

Grey Divider

Qodo Logo

@tylerkron
tylerkron added this pull request to the merge queue Aug 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 28, 2026
#702 (TimeProvider seam) landed on main and touched eight files this branch had
converted to file-scoped namespaces, so every conflict was #702's content against
this branch's dedent of the same lines.

Resolved by taking origin/main's version of all eight verbatim and re-running
`dotnet format style --diagnostics IDE0161` over the result, rather than by hand-
merging: this branch's only change to those files was the namespace conversion
(verified with `git diff -w` against the merge base - not one substantive line),
so re-deriving it mechanically cannot drop any of #702's work.

Checked after the merge: `git diff -w` against origin/main shows no changed line
outside .editorconfig, Directory.Build.props, CONTRIBUTING.md,
DEVICE_INTERFACES.md, IntelHexParser.cs, PublicAPI.Unshipped.txt and the two test
files that is anything other than a namespace or brace line.
@tylerkron

Copy link
Copy Markdown
Contributor Author

/agentic_review

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 4f71f20

@tylerkron
tylerkron added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit d75d82a Aug 29, 2026
4 checks passed
@tylerkron
tylerkron deleted the chore/484-editorconfig-style-enforcement branch August 29, 2026 14:10
tylerkron added a commit that referenced this pull request Sep 27, 2026
…e real handshake

Two review findings on the ServerInstructions change:

- The "retrieve before you stream" rule told every client that a live
  stream collapses the SD buffer and empties later downloads. That is
  firmware #703, which firmware 3.7.3 fixed. v3.7.2 is still the latest
  stable release, so the advice still matters, but stated unconditionally
  it is wrong for any device on the fix. The handshake rule, the
  download_sd_file description and the README now say "on firmware below
  3.7.3", and point at the firmwareVersion discover_devices already
  returns. The recovery step now says "power-cycled" rather than
  "reconnected", which is what the firmware issue and
  SdCardEmptyTransferException both say clears it.
- The instruction tests read ServerOptions.Instructions directly, so they
  stayed green with the o.ServerInstructions assignment in Program.cs
  deleted. ServerInstructionsHandshakeTests now starts the real server
  over stdio with the SDK's own client and reads `instructions` off the
  initialize result, with and without --read-only. Deleting the
  assignment turns both red on net9.0 and net10.0. The direct tests
  they replace are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add .editorconfig + style enforcement; rename the two public SCREAMING_SNAKE constants

1 participant