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

[Fix] namespace scopes #3503

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Sep 28, 2024

Change Log

  • Changed the namespace scope from file_scoped to block_scoped for some files.
  • Also change .editorconfig to error on future namespace file_scoped files.
  • Also did dotnet format on repo to fix any other problems.

Example of Scoped file changes

file_scoped

using System;

namespace My.Namespace;

public class MyClass
{
}

block_scoped

using System;

namespace My.Namespace
{
    public class MyClass
    {
    }
}

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • 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 not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Jim8y
Copy link
Contributor

Jim8y commented Sep 28, 2024

emmmmm, i definately love this, but many unrelated change right? that part i dont like~~~~

@cschuchardt88
Copy link
Member Author

We agreed a while back that we wouldn't use File_Scoped namespacing in the repo. Back when I formatted this repo with .editorconfig.

@shargon
Copy link
Member

shargon commented Sep 28, 2024

Is not better the other one? Now is the default I think

@cschuchardt88
Copy link
Member Author

block_scoped is the default one. But there is some files that are file_scoped. Also block_scoped was not set in the .editorconfig, but now it is and errors on file_scoped; to prevent them getting committed.

Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

I feel that we are moving from A to B and from B to A

@cschuchardt88
Copy link
Member Author

I don't know what a or b is. We're just removing the file scoped namespacing. So all the code syntax is the same layout. I don't know who to blame (I guess I could look). But somebody allowed file scoped namespacing to be committed to the repo I was surprised to see how many was there.

{
public static bool ConstantTimeEq<T>(in T a, in T b) where T : unmanaged
public static class ConstantTimeUtility
Copy link
Member

Choose a reason for hiding this comment

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

Please focus in the PR changes, hard to review like this

Copy link
Member Author

@cschuchardt88 cschuchardt88 Oct 4, 2024

Choose a reason for hiding this comment

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

Everything is wrapped with { }, nothing else has changed

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.

3 participants