https://github.com/vbfox/externalannotationsgenerator
Fluent Library for generating ReSharper External annotation files.
https://github.com/vbfox/externalannotationsgenerator
Last synced: 10 months ago
JSON representation
Fluent Library for generating ReSharper External annotation files.
- Host: GitHub
- URL: https://github.com/vbfox/externalannotationsgenerator
- Owner: vbfox
- License: other
- Created: 2015-09-17T06:53:59.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-28T12:54:32.000Z (over 10 years ago)
- Last Synced: 2024-11-29T19:17:00.930Z (over 1 year ago)
- Language: C#
- Homepage:
- Size: 387 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# ReSharper external annotations generator Library
[![Join the chat in Gitter][GitterBadge]][Gitter]
[![Build status][AppVeyorBadge]][AppVeyor]
[![MIT License][LicenseBadge]](License.md)
[![Nuget Package][NuGetBadge]][NuGet]
Fluent Library for generating [JetBrain's ReSharper][R#] External annotation
files.
## Syntax
The syntax used to create an annotation is a fluent syntax like :
```csharp
var annotator = Annotator.Create();
annotator.Annotate(type =>
{
type.Annotate(logger => logger.Debug(NotNull(), FormatString(), Some()));
});
annotator.Annotate(type =>
{
type.Annotate(logger => logger.GetLogger(NotNull()) == NotNull());
});
```
The annotations that can be found in `AnnotationGenerator.Annotations` are :
* `Some`: Used as a marker for a parameter without any special attribute.
* `NotNull`: Adds `[NotNullAttribute]` to either a parameter, member or
method result.
* `CanBeNull`: Adds `[CanBeNullAttribute]` to either a parameter, member or
method result.
* `FormatString`: Adds `[StringFormatMethodAttribute]` to the method with the
corresponding parameter name and `[NotNullAttribute]` to the parameter.
* `NullableFormatString`: Adds `[StringFormatMethodAttribute]` to the method
with the corresponding parameter name and `[CanBeNullAttribute]` to the parameter.
## Thanks
This project started as a fork of [ReSharper.ExternalAnnotations.Generator][Upstream] by
[@chillitom][chillitom] and might not have existed without it.
[GitterBadge]: https://badges.gitter.im/Join%20Chat.svg
[Gitter]: https://gitter.im/vbfox/ExternalAnnotationsGenerator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[NuGetBadge]: https://img.shields.io/nuget/v/ExternalAnnotationsGenerator.svg
[NuGet]: https://www.nuget.org/packages/ExternalAnnotationsGenerator
[LicenseBadge]: https://img.shields.io/badge/license-MIT%20License-blue.svg
[AppVeyorBadge]: https://ci.appveyor.com/api/projects/status/9dqk508uujs5ql2w?svg=true
[AppVeyor]: https://ci.appveyor.com/project/vbfox/externalannotationsgenerator
[R#]: https://www.jetbrains.com/resharper/
[chillitom]: https://github.com/chillitom
[Upstream]: https://github.com/chillitom/ReSharper.ExternalAnnotations.Generator