Skip to content

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

451 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotnet Stars Discord workflow nuget nuget Issues Open Forks License Twitter

Twitter Twitter

TimeWarp.SourceGenerators

TimeWarp Logo

TimeWarp.SourceGenerators ships Roslyn analyzers for C# file names, global usings, and the generic style rules TWA0004, TWA0023, and TWA0038.

Give a Star! ⭐

If you like or are using this project please give it a star. Thank you!

Features

File Name Rule Analyzer

Enforces kebab-case naming for C# files, including multi-dot partials (e.g. application-state.close-modal.cs) when every segment is kebab-case.

Configuration

Configure exceptions in .editorconfig:

[*.cs]
dotnet_diagnostic.TW0001.excluded_files = Program.cs;Startup.cs;*.Designer.cs

Global Usings Rule Analyzer (TW0007)

Reports file-level using directives that should move to kebab-case global-usings.cs, including usings after a file-scoped namespace X; (the gap in BDSoftware GlobalUsingsAnalyzer 1.4.0). Disabled by default.

[*.cs]
dotnet_diagnostic.TW0007.severity = warning
dotnet_diagnostic.TW0007.filename = global-usings.cs

See configure-global-usings-analyzer.md.

Generic rules moved from TimeWarp.Architecture.Analyzers

These ids are unchanged, so an existing .editorconfig entry still applies. Other TWA* ids stay in TimeWarp.Architecture.Analyzers.

ID Rule Default
TWA0004 #region Purpose in every non-generated C# file Warning, enabled
TWA0023 Identifier ends with its type stem Warning, disabled
TWA0038 File longer than 500 lines (max_lines overrides) Warning, enabled
[*.cs]
dotnet_diagnostic.TWA0004.severity = warning
dotnet_diagnostic.TWA0023.severity = none
dotnet_diagnostic.TWA0038.severity = warning
dotnet_diagnostic.TWA0038.max_lines = 500

TWA0023 opt-out is [TypeStemIdentifier("reason")]. The attribute type stays in TimeWarp.Architecture.Attributes and is matched by simple name.

Diagnostic ID prefixes (SSOT)

Prefix Where it lives
TW TimeWarp.SourceGenerators — TW0001 and TW0007
TWA0004, TWA0023, TWA0038 TimeWarp.SourceGenerators — generic style rules moved from Architecture.Analyzers. Same ids.
other TWA* TimeWarp.Architecture.Analyzers — contracts, endpoints, slices, and the rest

File-name kebab-case is TW0001 (dotnet_diagnostic.TW0001.*, #pragma warning disable TW0001). Do not configure that rule with a TWA* id.

Getting started

To quickly get started I recommend reviewing the samples in this repo.

Installation

dotnet add package TimeWarp.SourceGenerators

You can see the latest NuGet packages from the official TimeWarp NuGet page.

Releases

See the Release Notes

Unlicense

License

Contributing

Time is of the essence. Before developing a Pull Request I recommend opening a discussion.

Please feel free to make suggestions and help out with the documentation. Please refer to Markdown for how to write markdown files.

Contact

Sometimes the github notifications get lost in the shuffle. If you file an issue and don't get a response in a timely manner feel free to ping on our Discord server.

Discord

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages