neo icon indicating copy to clipboard operation
neo copied to clipboard

[`Fix`] namespace scopes

Open cschuchardt88 opened this issue 1 year ago • 5 comments

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)
  • [x] 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?

  • [x] N/A

Checklist:

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

cschuchardt88 avatar Sep 28 '24 14:09 cschuchardt88

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

Jim8y avatar Sep 28 '24 14:09 Jim8y

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

cschuchardt88 avatar Sep 28 '24 14:09 cschuchardt88

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

shargon avatar Sep 28 '24 16:09 shargon

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.

cschuchardt88 avatar Sep 28 '24 17:09 cschuchardt88

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.

cschuchardt88 avatar Oct 03 '24 11:10 cschuchardt88

Difference checked by my side

shargon avatar Nov 07 '24 13:11 shargon

@cschuchardt88 conflict again:)

NGDAdmin avatar Nov 08 '24 09:11 NGDAdmin

@cschuchardt88 conflict again:)

Maybe was my fault 😅

shargon avatar Nov 08 '24 09:11 shargon