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

Remove superfluous empty lines #9653

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

Rageking8
Copy link
Contributor

Summary

Mostly removed leading (just after the start of the snippet) empty lines as those are rendered and make the code snippet unnecessarily long (especially on mobile or smaller viewports). There are also some excess empty lines in between that are removed.

@Rageking8 Rageking8 requested a review from a team as a code owner February 28, 2024 11:05
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 28, 2024
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 28, 2024
@Rageking8
Copy link
Contributor Author

Unsure how to proceed given the large number of "missing project" CI errors.

Copy link

Learn Build status updates of commit 68840bc:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs ✅Succeeded View
snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs ✅Succeeded View
snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs ✅Succeeded View
snippets/csharp/System.Net.Sockets/MulticastOption/Overview/listener.cs ✅Succeeded View
snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs ✅Succeeded View
snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs ✅Succeeded View
snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs ✅Succeeded View
snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs ✅Succeeded View
snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs ✅Succeeded View

This comment lists only the first 25 files in the pull request.
For more details, please refer to the build report.

For any questions, please:

@BillWagner
Copy link
Member

Hi @Rageking8

Unsure how to proceed given the large number of "missing project" CI errors.

For any of the samples that build on .NET 8, these can be fixed by adding a default .csproj file in the same folder as the source. Then, the CI build will find the project and build it.

For projects that need the framework, and require Visual Studio to build, you'll need to create a Visual Studio project file in the same folder, and add a snippets.5000.json config file that specifies Visual Studio as the build host. (There are already several in this repo, just copy any of them into all the folders needed.

Historical note: This is an area of technical debt because all the samples were pulled from an internal system that had its own validation built in. We've added the CI build since then, and we've been paying down that technical debt whenever we update any of the samples.

@gewarren
Copy link
Contributor

gewarren commented Mar 5, 2024

All the errors we care about will be fixed by this PR: #9677. (The other errors are for legacy API code examples.)

@gewarren
Copy link
Contributor

gewarren commented Mar 6, 2024

@Rageking8 Can you fix the conflicts?

@Rageking8
Copy link
Contributor Author

Rageking8 commented Mar 7, 2024

I removed the conflicted changes, but the CI will still fail unless we merge main into this branch. (I don't have the repo cloned on my local machine, so its harder to perform this action)

Copy link

Learn Build status updates of commit b4f1d3a:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs ✅Succeeded View
snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs ✅Succeeded View
snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs ✅Succeeded View
snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs ✅Succeeded View
snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs ✅Succeeded View
snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs ✅Succeeded View
snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs ✅Succeeded View
snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs ✅Succeeded View
snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs ✅Succeeded View

This comment lists only the first 25 files in the pull request.
For more details, please refer to the build report.

For any questions, please:

Copy link

Learn Build status updates of commit 11d284e:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs ✅Succeeded View
snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs ✅Succeeded View
snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs ✅Succeeded View
snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs ✅Succeeded View
snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs ✅Succeeded View
snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs ✅Succeeded View
snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs ✅Succeeded View
snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs ✅Succeeded View
snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs ✅Succeeded View

This comment lists only the first 25 files in the pull request.
For more details, please refer to the build report.

For any questions, please:

Copy link

Learn Build status updates of commit b1ddef7:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Diagnostics/CounterCreationData/Overview/averagecount32.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/PerformanceCounter/NextValue/elapsedtime.cs ✅Succeeded View
snippets/csharp/System.Diagnostics/Process/StandardInput/process_standardinput.cs ✅Succeeded View
snippets/csharp/System.Drawing/Graphics/CopyFromScreen/Form1.cs ✅Succeeded View
snippets/csharp/System.IO/FileInfo/MoveTo/Program.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/.ctor/class11.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueue/BeginPeek/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionAccess/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Messaging/MessageQueuePermissionEntry/Overview/class1.cs ✅Succeeded View
snippets/csharp/System.Net.Sockets/IPv6MulticastOption/Overview/joinmulticastgroup.cs ✅Succeeded View
snippets/csharp/System.Net/IPAddress/IsLoopback/isloopback.cs ✅Succeeded View
snippets/csharp/System.Net/WebRequest/BeginGetResponse/webrequest_begingetresponse.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/AssemblyBuilder/Save/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/Assembly/enumbuilder_properties_5.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/EnumBuilder/GetCustomAttributes/enumbuilder_setcustomattribute1.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/Emit/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/ILGenerator/EmitCalli/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/MethodBuilder/GetILGenerator/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/PropertyBuilder/Overview/source.cs ✅Succeeded View
snippets/csharp/System.Reflection.Emit/TypeBuilder/CreateType/nestedenum.cs ✅Succeeded View
snippets/csharp/System.Reflection/AssemblyName/.ctor/assemblyname_constructor.cs ✅Succeeded View
snippets/csharp/System.Reflection/FieldInfo/IsInitOnly/source.cs ✅Succeeded View
snippets/csharp/System.Reflection/MemberInfo/IsDefined/memberinfo_getcustomattribute_isdefined.cs ✅Succeeded View
snippets/csharp/System.Reflection/ParameterInfo/IsIn/parameterinfo_isin_isout_isoptional.cs ✅Succeeded View

This comment lists only the first 25 files in the pull request.
For more details, please refer to the build report.

For any questions, please:

@Rageking8
Copy link
Contributor Author

@Rageking8 Can you fix the conflicts?

@gewarren The conflicts and CI errors are resolved.

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

THis LGTM.

Thanks for all the work @Rageking8

I'll wait to merge until @gewarren has a chance to review as well.

@BillWagner BillWagner merged commit b73ca7f into dotnet:main Mar 12, 2024
3 checks passed
@Rageking8 Rageking8 deleted the remove-superfluous-empty-lines branch March 30, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants