Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] Apply formatting on internal CDP generator #15049

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

RenderMichael
Copy link
Contributor

@RenderMichael RenderMichael commented Jan 8, 2025

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

enhancement


Description

  • Refactored property declarations to use auto-properties.

  • Replaced String with string for consistency.

  • Added null checks and improved exception handling.

  • Improved formatting and readability of the codebase.


Changes walkthrough 📝

Relevant files
Enhancement
26 files
CodeGenerationDefinitionTemplateSettings.cs
Refactored property declarations and formatting                   
+8/-32   
CodeGenerationSettings.cs
Refactored property declarations and formatting                   
+9/-41   
CodeGenerationTemplateSettings.cs
Refactored property declarations and formatting                   
+2/-10   
CodeGeneratorBase.cs
Simplified property getters using expression-bodied members
+3/-12   
CodeGeneratorContext.cs
Refactored property declarations                                                 
+2/-10   
CommandGenerator.cs
Added null checks and improved formatting                               
+3/-1     
CommandInfo.cs
Refactored property declarations                                                 
+5/-16   
DomainGenerator.cs
Added null checks and improved formatting                               
+3/-1     
EventGenerator.cs
Added null checks and improved formatting                               
+3/-1     
EventInfo.cs
Refactored property declarations                                                 
+3/-11   
IServiceProviderExtensions.cs
Added null checks for settings parameter                                 
+2/-0     
ProtocolGenerator.cs
Improved formatting and added null checks                               
+15/-7   
TemplatesManager.cs
Simplified property getters and added null checks               
+11/-6   
TypeGenerator.cs
Added null checks and improved formatting                               
+9/-1     
TypeInfo.cs
Refactored property declarations                                                 
+6/-26   
Utility.cs
Improved null checks and formatting                                           
+15/-4   
BooleanJsonConverter.cs
Simplified property getter and added exception                     
+3/-2     
Program.cs
Replaced `String` with `string` for consistency                   
+1/-1     
CommandDefinition.cs
Refactored property declarations                                                 
+5/-21   
DomainDefinition.cs
Refactored property declarations                                                 
+6/-26   
EventDefinition.cs
Refactored property declarations                                                 
+2/-6     
ProtocolDefinition.cs
Refactored property declarations                                                 
+3/-15   
ProtocolDefinitionItem.cs
Refactored property declarations and improved formatting 
+5/-21   
ProtocolVersionDefinition.cs
Simplified property getters and added exception handling 
+11/-33 
TypeDefinition.cs
Refactored property declarations and improved formatting 
+15/-47 
Version.cs
Refactored property declarations and improved formatting 
+5/-11   

💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

Copy link
Contributor

qodo-merge-pro bot commented Jan 8, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The Description property getter could return null if InitialDescription is null, which may cause NullReferenceException when trying to call Replace() on it.

get => InitialDescription?.Replace("<", "&lt;").Replace(">", "&gt;");

Copy link
Contributor

qodo-merge-pro bot commented Jan 8, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@RenderMichael RenderMichael changed the title [dotnet] Run formatting on CDP generator [dotnet] Apply formatting on internal CDP generator Jan 9, 2025
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.

Thanks @RenderMichael !

@nvborisenko nvborisenko merged commit 4aee006 into SeleniumHQ:trunk Jan 10, 2025
10 checks passed
@RenderMichael RenderMichael deleted the devtools-generator-format branch January 10, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants