Skip to content

[dotnet] update formatting rules#17019

Merged
titusfortner merged 15 commits intotrunkfrom
editorconfig
Jan 29, 2026
Merged

[dotnet] update formatting rules#17019
titusfortner merged 15 commits intotrunkfrom
editorconfig

Conversation

@titusfortner
Copy link
Member

@RenderMichael / @nvborisenko
Please look at the individual commits. If there is a style change that you don't think we should make, we need to change the rule in editorconfig.

We aren't hand-editing anything in this PR except the .editorconfig

🔗 Related Issues

Replaces #17011 (and a follow-on to #16999)

The previous PR was too much and too opaque

💥 What does this PR do?

  • Updates editorconfig file in dotnet to be explicit about expected behavior
  • I picked a handful of things to explicitly update to demonstrate the pattern
    • csharp_using_directive_placement = outside_namespace:warning (IDE1005)
    • Import ordering
    • dotnet_diagnostic.IDE1006.severity = suggestion # Naming rule violation
    • dotnet_diagnostic.IDE0059.severity = warning # Unnecessary assignment
    • dotnet_diagnostic.IDE0044.severity = warning # Make field readonly
    • dotnet_diagnostic.IDE0076.severity = warning # Invalid suppression
    • dotnet_diagnostic.IDE1005.severity = warning # Delegate invocation

🔧 Implementation Notes

  • Most of these are the defaults, but, again, want to be explicit about what is allowed in case someone does something weird
  • We want to run default //bazel:format -- style as part of linting process for things that can be automatically fixed, but IDE1006 cannot, so while the code has been updated to pass it, it has been marked suggestion instead of warning, so we can enforce it in a separate CI run.

💡 Additional Considerations

  • This is the last PR to set things up for the formatting / linting PR

🔄 Types of changes

  • Cleanup (formatting, renaming)

@selenium-ci selenium-ci added C-dotnet .NET Bindings B-support Issue or PR related to support classes labels Jan 28, 2026
@selenium-ci
Copy link
Member

Thank you, @titusfortner for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@titusfortner titusfortner changed the title Editorconfig [dotnet] update formatting rules Jan 28, 2026
@qodo-code-review
Copy link
Contributor

PR Type

Cleanup


Description

  • Expands .editorconfig with comprehensive C# formatting and style rules, including explicit configuration for whitespace, indentation, spacing, namespace declarations, and Roslyn diagnostic severity levels

  • Modernizes event invocation across multiple files by replacing null-check-then-invoke patterns with null-coalescing operator (?.Invoke())

  • Reorganizes using directives across 60+ files to follow system-first ordering convention (System namespaces first, followed by third-party and project-specific namespaces)

  • Renames private event handler methods and test methods from camelCase to PascalCase to comply with naming conventions (IDE1006)

  • Replaces unused variable assignments with discard operator (_) throughout test and source files

  • Makes pendingCommands field readonly in DevToolsSession.cs to enforce immutability

  • Eliminates redundant variable initialization patterns by combining declaration and assignment

  • Removes unnecessary blank lines and unused variable assignments


File Walkthrough

Relevant files
Cleanup
26 files
EventFiringWebDriver.cs
Modernize event invocation using null-coalescing operator

dotnet/src/support/Events/EventFiringWebDriver.cs

  • Replaced null-check-then-invoke pattern with null-coalescing operator
    (?.Invoke()) in 18 event-raising methods
  • Modernizes delegate invocation syntax to be more concise and idiomatic
    C#
+17/-68 
EventFiringWebDriverTest.cs
Rename event handlers and reorganize imports                         

dotnet/test/support/Events/EventFiringWebDriverTest.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Renamed 12 private event handler methods from camelCase to PascalCase
    (e.g., firingDriver_Navigating to FiringDriver_Navigating)
  • Removed unused variable assignment in
    ShouldBeAbleToWrapSubclassesOfSomethingImplementingTheWebDriverInterface
    test
+27/-27 
CookieImplementationTest.cs
Clean up unused variables and reorganize imports                 

dotnet/test/common/CookieImplementationTest.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Replaced unused variable assignments with discard operator (_) in
    multiple test methods
  • Removed unnecessary blank lines between statements
+10/-11 
DevToolsSession.cs
Modernize event invocation and enforce field immutability

dotnet/src/webdriver/DevTools/DevToolsSession.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Made pendingCommands field readonly to enforce immutability
  • Replaced null-check-then-invoke pattern with null-coalescing operator
    in 3 event-raising methods
+5/-14   
UrlBuilder.cs
Eliminate redundant variable initialization                           

dotnet/test/common/Environment/UrlBuilder.cs

  • Removed unnecessary empty string initialization before assignment in 5
    methods
  • Simplified variable initialization by combining declaration and
    assignment
+5/-11   
Actions.cs
Replace unused variables with discard operator                     

dotnet/src/webdriver/Interactions/Actions.cs

  • Replaced unused variable assignments with discard operator (_) in 3
    methods
  • Removed unnecessary intermediate variable storage for method return
    values
+4/-4     
ObjectStateAssumptionsTest.cs
Rename method to PascalCase and clean up unused variables

dotnet/test/common/ObjectStateAssumptionsTest.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Renamed private method from variousMethodCallsToCheckAssumptions to
    VariousMethodCallsToCheckAssumptions (PascalCase)
  • Replaced unused variable assignments with discard operator in test
    methods
+8/-8     
JavaScript.cs
Modernize event invocation using null-coalescing operator

dotnet/src/webdriver/DevTools/JavaScript.cs

  • Replaced null-check-then-invoke pattern with null-coalescing operator
    in 3 event-raising methods
+3/-12   
BasicKeyboardInterfaceTest.cs
Clean up unused variables and reorganize imports                 

dotnet/test/common/Interactions/BasicKeyboardInterfaceTest.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Replaced unused variable assignments with discard operator in 2 test
    methods
  • Removed unnecessary blank lines
+5/-6     
NetworkManager.cs
Modernize event invocation and reorganize imports               

dotnet/src/webdriver/NetworkManager.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Replaced null-check-then-invoke pattern with null-coalescing operator
    in 2 event-raising methods
+3/-9     
Broker.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Broker.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
DriverFactory.cs
Reorganize imports and improve variable declaration           

dotnet/test/common/Environment/DriverFactory.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Moved variable declaration closer to its usage point
  • Removed unnecessary null initialization of driver variable
+5/-6     
PartialLinkTextMatchTest.cs
Eliminate redundant variable initialization                           

dotnet/test/common/PartialLinkTextMatchTest.cs

  • Reorganized using statements to follow system-first ordering
    convention
  • Removed unnecessary null initialization before assignment in 2 test
    methods
  • Simplified variable initialization by combining declaration and
    assignment
+3/-6     
SourceActions.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Input/SourceActions.cs

  • Reorganized using statements to follow system-first ordering
    convention
+2/-2     
UserPromptOpenedEventArgs.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/BrowsingContext/UserPromptOpenedEventArgs.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
DownloadEndEventArgsConverter.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Json/Converters/Polymorphic/DownloadEndEventArgsConverter.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
InputSourceActionsConverter.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Json/Converters/Enumerable/InputSourceActionsConverter.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
BrowsingContextModule.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
BrowsingContextNetworkModule.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
ClientWindowInfo.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
BrowsingContextScriptModule.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextScriptModule.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
DownloadEndEventArgs.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/BrowsingContext/DownloadEndEventArgs.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
SetForcedColorsModeThemeOverrideCommand.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Emulation/SetForcedColorsModeThemeOverrideCommand.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
EvaluateResultConverter.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Json/Converters/Polymorphic/EvaluateResultConverter.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
LogEntryConverter.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Json/Converters/Polymorphic/LogEntryConverter.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
RealmInfoConverter.cs
Reorganize imports to system-first ordering                           

dotnet/src/webdriver/BiDi/Json/Converters/Polymorphic/RealmInfoConverter.cs

  • Reorganized using statements to follow system-first ordering
    convention
+1/-1     
Configuration changes
1 files
.editorconfig
Comprehensive EditorConfig rules for C# formatting and linting

dotnet/.editorconfig

  • Expanded .editorconfig with comprehensive C# formatting and style
    rules
  • Added explicit configuration for whitespace, indentation, spacing, and
    namespace declarations
  • Configured Roslyn diagnostic severity levels for code style violations
    (IDE1006, IDE0059, IDE0044, IDE0076, IDE1005)
  • Added documentation of additional diagnostics to investigate with
    violation counts
+84/-1   
Formatting
48 files
WheelInputDevice.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/Interactions/WheelInputDevice.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Internal
+1/-1     
Credential.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/VirtualAuth/Credential.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Internal
+1/-1     
BiDiFixture.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/BiDiFixture.cs

  • Reordered using directives to place System.Threading.Tasks before
    third-party and project namespaces
+1/-1     
FirefoxDriverServiceTest.cs
Reorganize using directives by namespace order                     

dotnet/test/firefox/FirefoxDriverServiceTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
RemoteSessionCreationTests.cs
Reorganize using directives by namespace order                     

dotnet/test/remote/RemoteSessionCreationTests.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
InternetExplorerDriver.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/IE/InternetExplorerDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Remote
+1/-1     
BrowserTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Browser/BrowserTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
WebExtensionTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/WebExtension/WebExtensionTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
FileLogHandlerTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/Internal/Logging/FileLogHandlerTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
ScriptCommandsTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Script/ScriptCommandsTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
ScriptEventsTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Script/ScriptEventsTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
PopupWindowFinderTest.cs
Reorganize using directives by namespace order                     

dotnet/test/support/UI/PopupWindowFinderTest.cs

  • Reordered using directives to place System.Threading.Tasks before
    third-party and project namespaces
+1/-1     
IActionExecutor.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/IActionExecutor.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Interactions
+1/-1     
LogTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Log/LogTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
CallFunctionLocalValueTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Script/CallFunctionLocalValueTest.cs

  • Reordered using directives to place NUnit.Framework after
    System.Threading.Tasks
+1/-1     
CallFunctionRemoteValueTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Script/CallFunctionRemoteValueTest.cs

  • Reordered using directives to place NUnit.Framework after
    System.Threading.Tasks
+1/-1     
StableChannelRemoteChromeDriver.cs
Reorganize using directives by namespace order                     

dotnet/test/common/CustomDriverConfigs/StableChannelRemoteChromeDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Chrome
+1/-1     
ILocatable.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/ILocatable.cs

  • Reordered using directives to place System.Drawing before
    OpenQA.Selenium.Interactions.Internal
+1/-1     
ElementEqualityTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ElementEqualityTest.cs

  • Reordered using directives to place System.Collections.ObjectModel
    before third-party and project namespaces
+1/-1     
NetworkInterceptionTests.cs
Reorganize using directives by namespace order                     

dotnet/test/common/NetworkInterceptionTests.cs

  • Reordered using directives to place System.Threading.Tasks before
    third-party and project namespaces
+1/-1     
TestInternetExplorerRemoteWebDriver.cs
Reorganize using directives by namespace order                     

dotnet/test/remote/TestInternetExplorerRemoteWebDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.IE
+1/-1     
ElementCoordinates.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/ElementCoordinates.cs

  • Reordered using directives to place System namespace before
    project-specific namespaces
+1/-1     
EvaluateParametersTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/BiDi/Script/EvaluateParametersTest.cs

  • Reordered using directives to place NUnit.Framework after
    System.Threading.Tasks
+1/-1     
ImplicitWaitTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ImplicitWaitTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
FirefoxRemoteWebDriver.cs
Reorganize using directives by namespace order                     

dotnet/test/remote/FirefoxRemoteWebDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Firefox
+1/-1     
AssemblyFixture.cs
Reorganize using directives by namespace order                     

dotnet/test/common/AssemblyFixture.cs

  • Reordered using directives to place System.Threading.Tasks before
    third-party and project namespaces
+1/-1     
ActionBuilderTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/Interactions/ActionBuilderTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
LogTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/Internal/Logging/LogTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
MiscTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/MiscTest.cs

  • Reordered using directives to place System.Collections.Generic before
    third-party and project namespaces
+1/-1     
SelectElementHandlingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/SelectElementHandlingTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
ChromeRemoteWebDriver.cs
Reorganize using directives by namespace order                     

dotnet/test/remote/ChromeRemoteWebDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Chrome
+1/-1     
EdgeRemoteWebDriver.cs
Reorganize using directives by namespace order                     

dotnet/test/remote/EdgeRemoteWebDriver.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Edge
+1/-1     
SvgElementTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/SvgElementTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
ITargetLocator.cs
Reorganize using directives by namespace order                     

dotnet/src/webdriver/ITargetLocator.cs

  • Reordered using directives to place System namespace before
    OpenQA.Selenium.Internal
+1/-1     
ExecutingAsyncJavascriptTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ExecutingAsyncJavascriptTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
FrameSwitchingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/FrameSwitchingTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
TimeoutDriverOptionsTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/TimeoutDriverOptionsTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
UnexpectedAlertBehaviorTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/UnexpectedAlertBehaviorTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
ContentEditableTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ContentEditableTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
SessionHandlingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/SessionHandlingTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
WebDriverWaitTest.cs
Reorganize using directives by namespace order                     

dotnet/test/support/UI/WebDriverWaitTest.cs

  • Reordered using directives to place System namespace before
    third-party namespaces
+1/-1     
ClickTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ClickTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
BasicWheelInterfaceTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/Interactions/BasicWheelInterfaceTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespace
+1/-1     
PageLoadingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/PageLoadingTest.cs

  • Reordered using directives to place System namespace before
    third-party and project namespaces
+1/-1     
SlowLoadableComponentTest.cs
Reorganize using directives by namespace order                     

dotnet/test/support/UI/SlowLoadableComponentTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespace
+1/-1     
DriverElementFindingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/DriverElementFindingTest.cs

  • Reordered using directives to place NUnit.Framework after
    System.Collections.ObjectModel
+1/-1     
ElementElementFindingTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/ElementElementFindingTest.cs

  • Reordered using directives to place NUnit.Framework after
    System.Collections.ObjectModel
+1/-1     
NavigationTest.cs
Reorganize using directives by namespace order                     

dotnet/test/common/NavigationTest.cs

  • Reordered using directives to place NUnit.Framework after System
    namespaces
+1/-1     
Additional files
101 files
GlobalSuppressions.cs +0/-12   
BiDi.cs +1/-1     
BrowserModule.cs +1/-1     
ClientWindow.cs +1/-1     
BrowsingContextInputModule.cs +1/-1     
BrowsingContextLogModule.cs +1/-1     
CaptureScreenshotCommand.cs +1/-1     
CreateCommand.cs +1/-1     
Locator.cs +1/-1     
NavigateCommand.cs +1/-1     
Navigation.cs +1/-1     
PrintCommand.cs +1/-1     
SetViewportCommand.cs +1/-1     
EmulationModule.cs +1/-1     
SetScreenOrientationOverrideCommand.cs +1/-1     
ITransport.cs +2/-2     
InputModule.cs +1/-1     
Origin.cs +1/-1     
BrowserClientWindowConverter.cs +1/-1     
BrowserUserContextConverter.cs +1/-1     
ChannelConverter.cs +1/-1     
CollectorConverter.cs +1/-1     
HandleConverter.cs +1/-1     
InputOriginConverter.cs +1/-1     
InterceptConverter.cs +1/-1     
InternalIdConverter.cs +1/-1     
NavigationConverter.cs +1/-1     
RemoteValueConverter.cs +1/-1     
PreloadScriptConverter.cs +1/-1     
PrintPageRangeConverter.cs +1/-1     
RealmConverter.cs +1/-1     
RequestConverter.cs +1/-1     
WebExtensionConverter.cs +1/-1     
LogEntry.cs +2/-2     
LogModule.cs +1/-1     
AddDataCollectorCommand.cs +1/-1     
AddInterceptCommand.cs +1/-1     
BeforeRequestSentEventArgs.cs +1/-1     
Cookie.cs +1/-1     
FetchErrorEventArgs.cs +1/-1     
Initiator.cs +1/-1     
NetworkModule.cs +1/-1     
Request.cs +1/-1     
ResponseCompletedEventArgs.cs +1/-1     
ResponseStartedEventArgs.cs +1/-1     
SetCacheBehaviorCommand.cs +1/-1     
PermissionState.cs +1/-1     
PermissionsModule.cs +1/-1     
CallFunctionCommand.cs +1/-1     
Channel.cs +1/-1     
EvaluateCommand.cs +2/-2     
LocalValue.cs +1/-1     
RealmInfo.cs +1/-1     
RealmType.cs +1/-1     
RemoteValue.cs +2/-2     
ResultOwnership.cs +1/-1     
ScriptModule.cs +1/-1     
SerializationOptions.cs +1/-1     
SessionModule.cs +1/-1     
Subscription.cs +1/-1     
UserPromptHandler.cs +1/-1     
SetCookieCommand.cs +1/-1     
StorageModule.cs +1/-1     
WebExtensionModule.cs

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Jan 28, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #1234
🔴 Ensure that click() on a link whose href is JavaScript (e.g., javascript:alert(...))
triggers the JavaScript in Selenium 2.48 (Firefox) as it did in 2.47.1.
Provide or update a reproducible test case (or automated regression test) demonstrating
the behavior and preventing regressions.
Verify the fix specifically on Firefox 42.0 (32-bit on 64-bit machine) or applicable
supported Firefox versions.
🟡
🎫 #5678
🔴 Investigate and fix repeated ChromeDriver instantiation errors showing Error:
ConnectFailure (Connection refused) after the first instance on Ubuntu 16.04 / Chrome 65 /
ChromeDriver 2.35 / Selenium 3.9.0.
Provide guidance or code changes so that multiple consecutive driver instantiations do not
produce the connection-refused console errors.
Validate the resolution by reproducing the issue and confirming it no longer occurs under
the reported environment.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Jan 28, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Restore driver assignment
Suggestion Impact:The commit changed the discard of wrapper.WrappedDriver back to an assignment to the driver variable inside Reset, restoring the intended wrapped driver update logic.

code diff:

@@ -662,7 +662,7 @@
                 driverAsType = wrapper.WrappedDriver as T;
                 if (driverAsType != null)
                 {
-                    _ = wrapper.WrappedDriver;
+                    driver = wrapper.WrappedDriver;
                     break;
                 }

In the Reset method, restore the assignment of wrapper.WrappedDriver to the
driver field instead of discarding it.

dotnet/src/webdriver/Interactions/Actions.cs [665]

-_ = wrapper.WrappedDriver;
+driver = wrapper.WrappedDriver;

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: The PR incorrectly changed a necessary assignment to a discard, which would break the logic of the Reset method by failing to update the wrapped driver.

High
  • Update

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the .NET .editorconfig file to explicitly define code formatting and style rules, then applies automated formatting fixes across the codebase. The changes establish a foundation for enforcing consistent code style in the .NET binding through CI.

Changes:

  • Configures explicit formatting rules in .editorconfig (whitespace, indentation, spacing, namespace declarations)
  • Applies automated formatting fixes for import ordering, readonly fields, unnecessary assignments, null-conditional operators, and naming conventions
  • Removes obsolete code analysis suppressions

Reviewed changes

Copilot reviewed 274 out of 274 changed files in this pull request and generated no comments.

Show a summary per file
File Description
dotnet/.editorconfig Adds comprehensive formatting and style rules including import ordering, namespace declarations, and specific IDE diagnostics
dotnet/test/**/*.cs Reorders imports to place System namespaces first and fixes naming conventions (e.g., testShouldSetBooleanPreferences → ShouldSetBooleanPreferences)
dotnet/test/**/DriverTestFixture.cs Adds pragma to suppress IDE1006 for legacy public member names
dotnet/test/**/DefaultWaitTest.cs Adds readonly modifier to startDate field
dotnet/test/**/EventFiringWebDriverTest.cs Fixes event handler naming to use PascalCase, removes unnecessary assignments
dotnet/test/common/**/AssemblyTeardown.cs Reorders imports across multiple test assemblies
dotnet/test/common/**/Environment/*.cs Removes unnecessary variable initializations and simplifies code
dotnet/src/webdriver/**/*.cs Reorders imports, adds readonly modifiers to fields, uses null-conditional operators for event invocations
dotnet/src/webdriver/GlobalSuppressions.cs Removes obsolete code analysis suppressions
dotnet/src/support/GlobalSuppressions.cs Removes obsolete code analysis suppressions
dotnet/src/support/Events/EventFiringWebDriver.cs Simplifies event invocations using null-conditional operator

Copy link
Member

@nvborisenko nvborisenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left minor comments to double check. If somebody can verify there is no hidden bugs, let's proceed further. Thanks.

@titusfortner
Copy link
Member Author

@RenderMichael & @nvborisenko I just reverted the 2 commits that were concerning. Ideally one or both of you can go through the TODO section in editorconfig and add the things you want to see. I think the more consistent we are with common formatting practices across the project the better.

Another thing I didn't address here, but our test class names are all over the place. Should the bee Something, SomethingTest or SomethingTests. Ideally it's consistent, but out of scope for this.

@titusfortner titusfortner merged commit cca0889 into trunk Jan 29, 2026
57 checks passed
@titusfortner titusfortner deleted the editorconfig branch January 29, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-support Issue or PR related to support classes C-dotnet .NET Bindings Review effort 4/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants