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

Template/Repo: Use File Scoped Namespaces #148

Closed
michael-hawker opened this issue Jun 8, 2022 · 1 comment · Fixed by #153
Closed

Template/Repo: Use File Scoped Namespaces #148

michael-hawker opened this issue Jun 8, 2022 · 1 comment · Fixed by #153
Assignees
Labels
enhancement Improvement to an existing feature templating

Comments

@michael-hawker
Copy link
Member

I noticed we're using the extra indent in the namespace, since we're using newer C# language level, we can just condense this using the flat namespaces (they're really nice).

namespace CommunityToolkit.Labs.WinUI
{
public class ProjectTemplate
{
}
}

Would become:

namespace CommunityToolkit.Labs.WinUI;
 
public class ProjectTemplate 
{ 
} 

We'd want to update all the files in the template for library, samples, tests. And possible anywhere else in the repo, like the main sample app.

Along with #144, should help keep things pretty lean and clean for getting started with an experiment.

@michael-hawker michael-hawker added the enhancement Improvement to an existing feature label Jun 8, 2022
@michael-hawker michael-hawker added this to the Initial Release milestone Jun 8, 2022
@mrlacey
Copy link
Contributor

mrlacey commented Jun 8, 2022

As I was confused by the issue title and assumed this was going to be something else. This feature is called "File Scoped Namespaces" https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces 😉

@michael-hawker michael-hawker changed the title Template/Repo: Flatten namespace usage Template/Repo: Use File Scoped Namespaces Jun 8, 2022
mrlacey added a commit that referenced this issue Jun 14, 2022
michael-hawker pushed a commit that referenced this issue Jun 14, 2022
* Initial conversion to use File scoped namespaces

Fixes #148

* Remove indents that the codefix didn't address
Martin1994 pushed a commit to Martin1994/Labs-Windows that referenced this issue Sep 2, 2023
* Initial conversion to use File scoped namespaces

Fixes CommunityToolkit#148

* Remove indents that the codefix didn't address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature templating
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants