Skip to content

lkurzyniec/amusing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amusing

Amusing build status Amusing NuGet version License

A command-line tool that shows what namespaces you am-using.

Intended to help make the best use of the implicit usings features of C# 10 / .NET 6.

Example

$ amusing MySolution.sln
225    Xunit
207    Moq
151    BigCorp.Splines.Reticulator
<snip>

This shows that both Xunit and Moq namespaces are widely used.

Assuming C# 10 or later and .NET SDK 6 or later, we can make those explicit by placing a Directory.Build.props file in our test/ path, containing:

<Project>

  <PropertyGroup>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <Using Include="Xunit" />
    <Using Include="Moq" />
  </ItemGroup>

</Project>

With that, all source under that location will implicitly import those namespaces.

You can run a Roslyn codefix to remove the previous using Xunit; and using Moq; directives, which will now be marked as redundant.

Installation

This utility is provided as a .NET global tool.

dotnet tool install -g amusing

Thanks

About

A command-line tool that shows what namespaces you am-using.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C# 100.0%