-
-
Notifications
You must be signed in to change notification settings - Fork 739
Fix formatting and add GitHub Action to check trailing whitespace #927
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
Fix formatting and add GitHub Action to check trailing whitespace #927
Conversation
There was a problem hiding this 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 improves code quality by removing trailing whitespace across the codebase and introduces a GitHub Action workflow to automatically check for trailing whitespace in future pull requests. The changes are primarily formatting-related with no functional modifications to the code.
Key Changes:
- Added a comprehensive GitHub Action workflow to check for trailing whitespace in pull requests
- Removed trailing whitespace from 60+ files across TypeScript, C#, and project configuration files
- Added ReSharper
.DotSettingsconfiguration file
Reviewed Changes
Copilot reviewed 49 out of 108 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/trailing-whitespace-check.yml |
New GitHub Action workflow to automatically check for trailing whitespace in PRs |
src/ElectronNET.sln.DotSettings |
Added ReSharper configuration for code formatting standards |
src/ElectronNET.WebApp/ElectronHostHook/connector.ts |
Removed trailing whitespace from TypeScript connector file |
src/ElectronNET.WebApp/Controllers/*.cs |
Removed trailing whitespace from controller files |
src/ElectronNET.IntegrationTests/Tests/*.cs |
Removed trailing whitespace and added blank lines for consistency in test files |
src/ElectronNET.Host/api/*.ts |
Removed trailing whitespace from TypeScript API files |
src/ElectronNET.Build/ElectronNET.Build.csproj |
Fixed indentation and removed trailing whitespace in project file |
src/ElectronNET.API/**/*.cs |
Removed trailing whitespace, fixed spacing around colons in class declarations, and standardized file endings across 40+ API files |
nuke/ReleaseNotesParser.cs |
Removed trailing whitespace from build script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The checkout action should also fetch the base branch to ensure accurate diff comparison. Consider adding:
- name: Fetch base branch
run: git fetch origin ${{ github.event.pull_request.base.ref }}before the "Check for trailing whitespace" step, or use fetch-depth: 2 instead of 0 for better performance.
| - name: Fetch base branch | |
| run: git fetch origin ${{ github.event.pull_request.base.ref }} |
| fi | ||
| # File patterns to check (text files) | ||
| PATTERNS="\.cs$|\.csproj$|\.sln$|\.ts$|\.html$|\.css$|\.scss$" |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The pattern .sln$ is included in the check patterns, but the .DotSettings file being added in this PR is not covered. Consider adding \.DotSettings$ to the patterns if you want to check these configuration files for trailing whitespace as well.
| PATTERNS="\.cs$|\.csproj$|\.sln$|\.ts$|\.html$|\.css$|\.scss$" | |
| PATTERNS="\.cs$|\.csproj$|\.sln$|\.DotSettings$|\.ts$|\.html$|\.css$|\.scss$" |
| { | ||
| tcs.SetException(new InvalidOperationException(error)); | ||
| }); | ||
| BridgeConnector.Socket.Once<string>("webContents-loadURL-error" + Id, (error) => { tcs.SetException(new InvalidOperationException(error)); }); |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] While condensing this lambda to a single line removes trailing whitespace, it may reduce readability. Consider keeping multi-line lambdas on separate lines for better code clarity, especially when they contain meaningful logic like exception handling.
| { | ||
| _notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]); | ||
| }); | ||
| BridgeConnector.Socket.On<string[]>("NotificationEventReply", (args) => { _notificationOptions.Single(x => x.ReplyID == args[0]).OnReply(args[1]); }); |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Similar to the comment above, condensing this multi-line lambda with meaningful logic into a single line may reduce readability. Consider keeping it on separate lines for better code clarity.
| { | ||
| _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); | ||
| }); | ||
| BridgeConnector.Socket.On<string[]>("NotificationEventAction", (args) => { _notificationOptions.Single(x => x.ActionID == args[0]).OnAction(args[1]); }); |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Similar to the comments above, condensing this multi-line lambda with meaningful logic into a single line may reduce readability. Consider keeping it on separate lines for better code clarity.
| { | ||
| Electron.Dialog.ShowErrorBox("Host Hook Exception", result); | ||
| }); | ||
| BridgeConnector.Socket.Once<string>(socketEventName + "Error" + oneCallguid, (result) => { Electron.Dialog.ShowErrorBox("Host Hook Exception", result); }); |
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Similar to the comments above, condensing this multi-line lambda with error handling logic into a single line may reduce readability. Consider keeping it on separate lines for better code clarity.
| @@ -0,0 +1,7 @@ | |||
| <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | |||
Copilot
AI
Nov 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in XML namespace: "shemas" should be "schemas". This should be xmlns:ss="urn:schemas-jetbrains-com:settings-storage-xaml".
48d9ffb to
40b0cf5
Compare
40b0cf5 to
8e7892e
Compare
|
Rebased |
FlorianRappl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.