├── vostok.devtools
├── Directory.Build.props
├── launchpad-templates
│ ├── library-ordinary
│ │ ├── template
│ │ │ ├── CHANGELOG.md
│ │ │ ├── {{ProjectName}}
│ │ │ │ ├── PublicAPI.Shipped.txt
│ │ │ │ ├── PublicAPI.Unshipped.txt
│ │ │ │ └── Properties
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ ├── .editorconfig
│ │ │ ├── module.yaml
│ │ │ ├── .github
│ │ │ │ └── workflows
│ │ │ │ │ └── ci.yml
│ │ │ ├── README.md
│ │ │ └── {{ProjectName}}.Tests
│ │ │ │ └── {{ProjectName}}.Tests.csproj
│ │ ├── pack.cmd
│ │ └── push-to-nuget.cmd
│ ├── library-source
│ │ ├── template
│ │ │ ├── CHANGELOG.md
│ │ │ ├── .editorconfig
│ │ │ ├── {{ProjectName}}
│ │ │ │ ├── Properties
│ │ │ │ │ └── AssemblyInfo.cs
│ │ │ │ └── SampleClass.cs
│ │ │ ├── .github
│ │ │ │ └── workflows
│ │ │ │ │ └── ci.yml
│ │ │ ├── module.yaml
│ │ │ ├── README.md
│ │ │ └── {{ProjectName}}.Tests
│ │ │ │ └── {{ProjectName}}.Tests.csproj
│ │ ├── pack.cmd
│ │ └── push-to-nuget.cmd
│ └── readme.md
├── launchpad
│ ├── install-local.cmd
│ ├── push-to-nuget.cmd
│ ├── src
│ │ ├── TemplateDefinition.cs
│ │ ├── VariableDefinition.cs
│ │ ├── LaunchpadSpec.cs
│ │ ├── LaunchpadConfig.cs
│ │ └── LaunchpadSpecProvider.cs
│ └── launchpad-config.json
├── vostok-release
│ ├── install.cmd
│ ├── install.sh
│ └── readme.txt
├── assets
│ ├── Vostok-icon.png
│ ├── vostok-logo.png
│ ├── vostok-white-black.png
│ ├── vostok-konfur-black.png
│ └── vostok-white-transparent.png
├── dotnetprojectrefs
│ ├── install.cmd
│ └── readme.txt
├── tcs-create-options
│ ├── install.cmd
│ ├── readme.txt
│ └── tcscreateoptions.csproj
├── configure-await-false
│ ├── install.cmd
│ └── readme.txt
├── dotnetprojectorderer
│ ├── install.cmd
│ └── readme.txt
├── dotnetversionsuffix
│ ├── install.cmd
│ ├── readme.txt
│ └── dotnetversionsuffix.csproj
├── publicize.roslyn
│ ├── .editorconfig
│ ├── Vostok.Tools.Publicize.Roslyn.v1.dll
│ └── Vostok.Tools.Publicize.Roslyn
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── dotnetcementrefs
│ ├── install.cmd
│ ├── external
│ │ └── Cement.Vostok.Devtools.dll
│ ├── dotnetcementrefs.sln.DotSettings
│ └── FileUtilities.cs
├── git-commit-to-assembly-title
│ ├── Vostok.Tools.GitCommit2AssemblyTitle.dll
│ ├── Vostok.Tools.GitCommit2AssemblyTitle.csproj
│ └── readme.txt
├── library-common-props
│ ├── Test-Project-new.props
│ ├── Main-Project-app.props
│ └── Main-Project-new.props
├── code-style-csharp
│ ├── .editorconfig
│ └── CSharpCodeStyle.SpaceIndent.DotSettings
├── library-ci
│ └── github_ci.yml
└── module.yaml
├── Kontur.Results.SourceGenerator
├── .editorconfig
├── Code
│ └── Methods
│ │ └── Conversion
│ │ └── Map
│ │ └── MethodNames.cs
└── ExtensionsSourceGenerator.cs
├── Kontur.Tests.Results
├── Base.cs
├── Child.cs
├── ICounter.cs
├── LibraryNamespace
│ ├── CustomFault.cs
│ ├── CustomValue.cs
│ ├── LibraryException.cs
│ ├── EnsureNoneExtensions.cs
│ ├── EnsureHasValueExtensions.cs
│ └── GetValueOrThrowOptionalExtensions.cs
├── IConsumer.cs
├── Inheritance
│ ├── IStringFaultConsumer.cs
│ ├── StringFault.cs
│ ├── StringFaultChild.cs
│ ├── Extraction
│ │ ├── TryGet
│ │ │ └── Common.cs
│ │ ├── Failure_Should.cs
│ │ ├── Success_Should.cs
│ │ ├── Get
│ │ │ ├── Values
│ │ │ │ └── Upcast
│ │ │ │ │ ├── Both_Should.cs
│ │ │ │ │ ├── Value_Should.cs
│ │ │ │ │ └── Fault_Should.cs
│ │ │ ├── Faults
│ │ │ │ └── Upcast
│ │ │ │ │ ├── Value_Should.cs
│ │ │ │ │ ├── Both_Should.cs
│ │ │ │ │ └── Fault_Should.cs
│ │ │ ├── OrDefault
│ │ │ │ ├── Value
│ │ │ │ │ ├── Upcast
│ │ │ │ │ │ ├── Both
│ │ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ │ ├── Value
│ │ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ │ └── Fault
│ │ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ ├── Struct
│ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ └── Class
│ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ └── Fault
│ │ │ │ │ └── Upcast
│ │ │ │ │ ├── Value
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ ├── Both
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ └── Fault
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ └── OrThrow
│ │ │ │ ├── Value
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ │ └── Fault
│ │ │ │ └── Standard_Exception_Should.cs
│ │ └── Ensure
│ │ │ ├── Failure
│ │ │ └── Standard_Exception_Should.cs
│ │ │ └── Success
│ │ │ └── Standard_Exception_Should.cs
│ ├── StringFaultResult.cs
│ ├── UpcastExample.TValue.TResult.cs
│ ├── Equality
│ │ ├── GetHashCode_Should.cs
│ │ └── Equals_Should.cs
│ ├── StringFaultBase.cs
│ ├── Conversion
│ │ └── Upcast
│ │ │ ├── Both_Should.cs
│ │ │ ├── Value_Should.cs
│ │ │ └── Fault_Should.cs
│ └── StringFaultResult.TValue.cs
├── Conversion
│ ├── Combinations
│ │ ├── Linq
│ │ │ ├── Optional
│ │ │ │ ├── OptionalOptional
│ │ │ │ │ ├── IConstantProvider.cs
│ │ │ │ │ ├── IntConstantProvider.cs
│ │ │ │ │ ├── IFixtureCase.cs
│ │ │ │ │ ├── Select
│ │ │ │ │ │ └── DifferentTypes
│ │ │ │ │ │ │ ├── StringConstantProvider.cs
│ │ │ │ │ │ │ └── LinqTestBase.TFixtureCase.cs
│ │ │ │ │ ├── NoneFixtureCase.cs
│ │ │ │ │ ├── SomeFixtureCase.cs
│ │ │ │ │ ├── SomeConstantFixtureCase.cs
│ │ │ │ │ └── LinqTestBase.ITestFixtureCase.cs
│ │ │ │ ├── Optional
│ │ │ │ │ ├── SelectCaseToTestCasesExtensions.cs
│ │ │ │ │ ├── Where
│ │ │ │ │ │ └── WhereCaseGenerator.cs
│ │ │ │ │ └── Select
│ │ │ │ │ │ └── DifferentTypes
│ │ │ │ │ │ └── SelectCaseToDifferentTypeTestCasesExtensions.cs
│ │ │ │ └── SelectCaseToTestCasesExtensions.cs
│ │ │ └── Result
│ │ │ │ ├── TValuePlain
│ │ │ │ ├── IFixtureCase.cs
│ │ │ │ ├── SuccessFixtureCase.cs
│ │ │ │ ├── FailureConstantFixtureCase.cs
│ │ │ │ ├── FailureVariableFixtureCase.cs
│ │ │ │ └── LinqTestBase.cs
│ │ │ │ ├── TValueTValue
│ │ │ │ ├── IConstantProvider.cs
│ │ │ │ ├── IFixtureCase.cs
│ │ │ │ ├── Select
│ │ │ │ │ └── DifferentTypes
│ │ │ │ │ │ ├── StringConstantProvider.cs
│ │ │ │ │ │ └── LinqTestBase.TFixtureCase.cs
│ │ │ │ ├── IntConstantProvider.cs
│ │ │ │ ├── FailureConstantFixtureCase.cs
│ │ │ │ ├── SuccessVariableFixtureCase.cs
│ │ │ │ ├── FailureVariableFixtureCase.cs
│ │ │ │ ├── SuccessConstantFixtureCase.cs
│ │ │ │ └── LinqTestBase.TFixtureCase.cs
│ │ │ │ ├── TValue
│ │ │ │ ├── SelectCaseToTestCasesExtensions.cs
│ │ │ │ ├── Select
│ │ │ │ │ └── DifferentTypes
│ │ │ │ │ │ └── SelectCaseToDifferentTypeTestCasesExtensions.cs
│ │ │ │ └── Where
│ │ │ │ │ └── WhereCaseGenerator.cs
│ │ │ │ └── SelectCaseToTestCasesExtensions.cs
│ │ └── ResultFactory.cs
│ └── Upcast
│ │ ├── Plain_Should.cs
│ │ ├── Optional_Should.cs
│ │ └── TValue
│ │ ├── Both_Should.cs
│ │ ├── Fault_Should.cs
│ │ └── Value_Should.cs
├── ValueTaskFactory.cs
├── UnreachableException.cs
├── Extraction
│ ├── TryGet
│ │ ├── Plain
│ │ │ └── Common.cs
│ │ ├── TValue
│ │ │ └── Common.cs
│ │ └── Optional
│ │ │ └── Common.cs
│ ├── Ensure
│ │ ├── Failure
│ │ │ ├── Plain
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ ├── None
│ │ │ │ ├── Standard_Exception_Contain_Value_Should.cs
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ └── TValue
│ │ │ │ ├── Standard_Exception_Contain_Value_Should.cs
│ │ │ │ └── Standard_Exception_Should.cs
│ │ └── Success
│ │ │ ├── HasValue
│ │ │ └── Standard_Exception_Should.cs
│ │ │ ├── Plain
│ │ │ ├── Standard_Exception_Contain_Fault_Should.cs
│ │ │ └── Standard_Exception_Should.cs
│ │ │ └── TValue
│ │ │ ├── Standard_Exception_Contain_Fault_Should.cs
│ │ │ └── Standard_Exception_Should.cs
│ ├── Get
│ │ ├── OrThrow
│ │ │ ├── Optional
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ ├── Plain
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ └── TValue
│ │ │ │ ├── Value
│ │ │ │ ├── Standard_Exception_Contain_Fault_Should.cs
│ │ │ │ └── Standard_Exception_Should.cs
│ │ │ │ └── Fault
│ │ │ │ ├── Standard_Exception_Contain_Value_Should.cs
│ │ │ │ └── Standard_Exception_Should.cs
│ │ ├── OrNull
│ │ │ ├── Plain_Should.cs
│ │ │ ├── Optional_Should.cs
│ │ │ └── TValue
│ │ │ │ ├── Fault_Should.cs
│ │ │ │ └── Value_Should.cs
│ │ ├── OrDefault
│ │ │ ├── Plain
│ │ │ │ ├── Upcast
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ ├── Struct
│ │ │ │ │ ├── NotNullable_Should.cs
│ │ │ │ │ └── Nullable_Should.cs
│ │ │ │ └── Class
│ │ │ │ │ ├── NonNullable_Should.cs
│ │ │ │ │ └── Nullable_Should.cs
│ │ │ ├── Optional
│ │ │ │ ├── Upcast
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ ├── Struct
│ │ │ │ │ ├── NotNullable_Should.cs
│ │ │ │ │ └── Nullable_Should.cs
│ │ │ │ └── Class
│ │ │ │ │ └── NonNullable_Should.cs
│ │ │ └── TValue
│ │ │ │ ├── Fault
│ │ │ │ ├── Struct
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ ├── Upcast
│ │ │ │ │ ├── Both
│ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ ├── Fault
│ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ │ └── Value
│ │ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ └── Class
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ └── Value
│ │ │ │ ├── Struct
│ │ │ │ └── NotNullable_Should.cs
│ │ │ │ ├── Upcast
│ │ │ │ ├── Both
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ ├── Value
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ └── Fault
│ │ │ │ │ └── NotNullable_Should.cs
│ │ │ │ └── Class
│ │ │ │ └── NotNullable_Should.cs
│ │ ├── Faults
│ │ │ └── TValue
│ │ │ │ └── Upcast
│ │ │ │ ├── Both_Should.cs
│ │ │ │ ├── Fault_Should.cs
│ │ │ │ └── Value_Should.cs
│ │ └── Values
│ │ │ └── TValue
│ │ │ └── Upcast
│ │ │ ├── Both_Should.cs
│ │ │ ├── Fault_Should.cs
│ │ │ └── Value_Should.cs
│ ├── SelectMany
│ │ └── FirstFault
│ │ │ ├── Optional
│ │ │ └── Using
│ │ │ │ └── SelectManyOptionalExtensions.cs
│ │ │ └── TValue
│ │ │ └── Using
│ │ │ └── SelectManyResultValueExtensions.cs
│ ├── Failure
│ │ ├── Plain_Should.cs
│ │ ├── IsNone_Should.cs
│ │ └── TValue_Should.cs
│ ├── Success
│ │ ├── Plain_Should.cs
│ │ ├── HasSome_Should.cs
│ │ └── TValue_Should.cs
│ └── ToString
│ │ ├── Optional_Should.cs
│ │ └── Plain_Should.cs
├── Instantiation
│ ├── Plain
│ │ ├── Create_Via_Non_Generic
│ │ │ └── Common.cs
│ │ └── Implicit_Operator_Should.cs
│ ├── Optional
│ │ ├── Create_Via_Non_Generic
│ │ │ └── Common.cs
│ │ └── Implicit_Operator_Should.cs
│ └── TValue
│ │ └── Create_Via_Non_Generic
│ │ └── Common.cs
├── UpcastPlainExample.TResult.cs
├── UpcastOptionalExample.TResult.cs
├── UpcastTValueExample.TFault.TValue.TResult.cs
├── Equality
│ ├── Plain
│ │ ├── GetHashCode_Should.cs
│ │ └── Equals_Should.cs
│ ├── Optional
│ │ ├── GetHashCode_Should.cs
│ │ └── Equals_Should.cs
│ └── TValue
│ │ ├── GetHashCode_Should.cs
│ │ └── Equals_Should.cs
├── UpcastOptionalExamples.cs
└── UpcastPlainExamples.cs
├── Kontur.Results.SourceGenerator.Monad
├── .editorconfig
├── Code
│ └── Methods
│ │ └── Conversion
│ │ └── Combinations
│ │ ├── Then
│ │ └── MethodNames.cs
│ │ ├── OrElse
│ │ └── MethodNames.cs
│ │ └── Linq
│ │ ├── Where
│ │ └── MethodNames.cs
│ │ ├── Select
│ │ └── MethodNames.cs
│ │ └── SelectMany
│ │ └── MethodNames.cs
└── MonadSourceGenerator.cs
├── Kontur.Results.SourceGenerator.Shared
├── .editorconfig
└── Code
│ ├── Methods
│ ├── IDescriptionProvider.cs
│ ├── MethodsDescription.cs
│ └── MethodsDescriptionProvider.cs
│ ├── CompilationUnit.cs
│ ├── CompilationFileProviderSettings.cs
│ ├── Internal
│ ├── MethodTypeGeneratorParameter.cs
│ ├── MethodTypeGenericParameter.cs
│ ├── MethodTypeInternal2.cs
│ ├── InternalMethodsDescription.cs
│ ├── InternalTypeParameter.cs
│ ├── InternalPartialMethodDescription.cs
│ ├── MethodTypeInternal3.cs
│ └── InternalStandardMethodsDescription.cs
│ ├── MethodGenericParameterDescription.cs
│ ├── Parameters.cs
│ ├── Public
│ ├── PublicMethodsDescription.cs
│ ├── MethodType2.cs
│ └── MethodType3.cs
│ ├── ClassNamesPass.cs
│ ├── AccessModifierFactory.cs
│ ├── ClassNamesPassExtensions.cs
│ ├── TaskLikeTypeSyntaxFactory.cs
│ ├── IMethodBodyFactory.cs
│ ├── SelfParameter.cs
│ ├── EnumerableExtensions.cs
│ ├── ITypeParameterGenericMethodSyntaxGenerator.cs
│ ├── IdentifierExtensions.cs
│ ├── ClassNamesFactoryExtensions.cs
│ ├── ParameterNames.cs
│ └── ClassNamesFactory.cs
├── Kontur.Results
├── Implementation
│ ├── Optional
│ │ ├── NoneMarker.cs
│ │ ├── IOptional.TValue.cs
│ │ ├── Some.TValue.cs
│ │ ├── None.TValue.cs
│ │ └── Optional.cs
│ ├── Result
│ │ ├── SuccessMarker.cs
│ │ ├── SuccessMarker.TValue.cs
│ │ ├── IResult.TFault.cs
│ │ ├── ResultFailure.TFault.TValue.cs
│ │ ├── ResultSuccess.TFault.TValue.cs
│ │ ├── IResult.TFault.TValue.cs
│ │ ├── ResultSuccess.TValue.cs
│ │ ├── ResultFailure.T.cs
│ │ └── Result.cs
│ └── Containers
│ │ ├── Plain
│ │ ├── IContainer.T.cs
│ │ ├── FilledContainer.T.cs
│ │ └── EmptyContainer.T.cs
│ │ └── ResultValue
│ │ ├── IContainer.TFault.TValue.cs
│ │ ├── FailureContainer.TFault.TValue.cs
│ │ └── SuccessContainer.TFault.TValue.cs
├── .editorconfig
├── .globalconfig
└── Extensions
│ ├── Extraction
│ ├── ResultFailedException.cs
│ ├── ValueExistsException.cs
│ ├── ResultSucceedException.cs
│ ├── ValueMissingException.cs
│ ├── Actions
│ │ ├── OnFailure
│ │ │ ├── OnNoneExtensions.cs
│ │ │ ├── OnFailureResultPlainExtensions.cs
│ │ │ └── OnFailureResultValueExtensions.cs
│ │ ├── OnSuccess
│ │ │ ├── OnSuccessResultPlainExtensions.cs
│ │ │ ├── OnSomeExtensions.cs
│ │ │ └── OnSuccessResultValueExtensions.cs
│ │ └── Switch
│ │ │ ├── SwitchOptionalExtensions.cs
│ │ │ └── SwitchResultPlainExtensions.cs
│ ├── ValueExistsException.TValue.cs
│ ├── ResultFailedException.TFault.cs
│ ├── ResultSucceedException.TValue.cs
│ ├── Get
│ │ ├── OrDefault
│ │ │ ├── Fault
│ │ │ │ ├── GetFaultOrDefaultResultPlainExtensions.cs
│ │ │ │ └── GetFaultOrDefaultResultValueExtensions.cs
│ │ │ └── Value
│ │ │ │ ├── GetValueOrDefaultOptionalExtensions.cs
│ │ │ │ └── GetValueOrDefaultResultValueExtensions.cs
│ │ ├── Enumerator
│ │ │ ├── GetEnumeratorOptionalExtensions.cs
│ │ │ └── GetEnumeratorResultValueExtensions.cs
│ │ ├── OrNull
│ │ │ ├── Fault
│ │ │ │ ├── GetFaultOrNullResultPlainExtensions.cs
│ │ │ │ └── GetFaultOrNullResultValueExtensions.cs
│ │ │ └── Value
│ │ │ │ ├── GetValueOrNullOptionalExtensions.cs
│ │ │ │ └── GetValueOrNullResultValueExtensions.cs
│ │ ├── Faults
│ │ │ ├── GetFaultsResultPlainExtensions.cs
│ │ │ └── GetFaultsResultValueExtensions.cs
│ │ ├── Values
│ │ │ ├── GetValuesOptionalExtensions.cs
│ │ │ └── GetValuesResultValueExtensions.cs
│ │ └── OrElse
│ │ │ ├── Value
│ │ │ └── GetValueOrElseOptionalExtensions.cs
│ │ │ └── Fault
│ │ │ └── GetFaultOrElseResultPlainExtensions.cs
│ └── Ensure
│ │ ├── Failure
│ │ └── EnsureFailureResultPlainExtensions.cs
│ │ └── Success
│ │ └── EnsureHasValueExtensions.cs
│ └── Conversion
│ └── Upcast
│ ├── UpcastResultPlainExtensions.cs
│ ├── UpcastOptionalExtensions.cs
│ └── UpcastResultValueExtensions.cs
├── Kontur.Results.Monad
└── .globalconfig
├── .build_nuget.bat
└── .editorconfig
/vostok.devtools/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | TODO
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/{{ProjectName}}/PublicAPI.Shipped.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/{{ProjectName}}/PublicAPI.Unshipped.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/pack.cmd:
--------------------------------------------------------------------------------
1 | nuget pack pack.nuspec -OutputDirectory nupkg
2 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/pack.cmd:
--------------------------------------------------------------------------------
1 | nuget pack pack.nuspec -OutputDirectory nupkg
2 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,vb}]
2 |
3 | dotnet_diagnostic.CA1812.severity = none
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Base.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results
2 | {
3 | public class Base
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,vb}]
2 |
3 | dotnet_diagnostic.CA1812.severity = none
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,vb}]
2 |
3 | dotnet_diagnostic.CA1812.severity = none
4 |
5 |
6 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/install-local.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g Vostok.Launchpad
--------------------------------------------------------------------------------
/vostok.devtools/vostok-release/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g vostok-release
--------------------------------------------------------------------------------
/vostok.devtools/vostok-release/install.sh:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g vostok-release
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Child.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results
2 | {
3 | public class Child : Base
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/vostok.devtools/assets/Vostok-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/assets/Vostok-icon.png
--------------------------------------------------------------------------------
/vostok.devtools/assets/vostok-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/assets/vostok-logo.png
--------------------------------------------------------------------------------
/vostok.devtools/dotnetprojectrefs/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g dotnetprojectrefs
--------------------------------------------------------------------------------
/vostok.devtools/tcs-create-options/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g tcscreateoptions
--------------------------------------------------------------------------------
/vostok.devtools/configure-await-false/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g configureawaitfalse
--------------------------------------------------------------------------------
/vostok.devtools/dotnetprojectorderer/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g dotnetprojectorderer
--------------------------------------------------------------------------------
/vostok.devtools/dotnetversionsuffix/install.cmd:
--------------------------------------------------------------------------------
1 | dotnet build -c Release
2 | dotnet tool update --add-source nupkg -g dotnetversionsuffix
--------------------------------------------------------------------------------
/vostok.devtools/publicize.roslyn/.editorconfig:
--------------------------------------------------------------------------------
1 | ; 4-column space indentation
2 | [*.{cs,tt}]
3 | indent_style = space
4 | indent_size = 4
--------------------------------------------------------------------------------
/vostok.devtools/assets/vostok-white-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/assets/vostok-white-black.png
--------------------------------------------------------------------------------
/vostok.devtools/assets/vostok-konfur-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/assets/vostok-konfur-black.png
--------------------------------------------------------------------------------
/vostok.devtools/assets/vostok-white-transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/assets/vostok-white-transparent.png
--------------------------------------------------------------------------------
/vostok.devtools/dotnetcementrefs/install.cmd:
--------------------------------------------------------------------------------
1 | pushd %~dp0
2 | dotnet build -c Release
3 | dotnet tool update --add-source nupkg -g dotnetcementrefs
4 | popd
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Optional/NoneMarker.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public readonly ref struct NoneMarker
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/SuccessMarker.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public readonly ref struct SuccessMarker
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/.editorconfig:
--------------------------------------------------------------------------------
1 | ; 4-column space indentation
2 | [*.{cs,tt}]
3 | indent_style = space
4 | indent_size = 4
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/.editorconfig:
--------------------------------------------------------------------------------
1 | ; 4-column space indentation
2 | [*.{cs,tt}]
3 | indent_style = space
4 | indent_size = 4
--------------------------------------------------------------------------------
/Kontur.Tests.Results/ICounter.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results
2 | {
3 | public interface ICounter
4 | {
5 | public void Increment();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/CustomFault.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.LibraryNamespace
2 | {
3 | internal class CustomFault
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/CustomValue.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.LibraryNamespace
2 | {
3 | internal class CustomValue
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/push-to-nuget.cmd:
--------------------------------------------------------------------------------
1 | rmdir /S /Q nupkg
2 | dotnet build -c Release
3 | nuget push nupkg\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey %1
--------------------------------------------------------------------------------
/Kontur.Tests.Results/IConsumer.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results
2 | {
3 | public interface IConsumer
4 | {
5 | public void Consume(string data);
6 | }
7 | }
--------------------------------------------------------------------------------
/vostok.devtools/dotnetcementrefs/external/Cement.Vostok.Devtools.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/dotnetcementrefs/external/Cement.Vostok.Devtools.dll
--------------------------------------------------------------------------------
/vostok.devtools/publicize.roslyn/Vostok.Tools.Publicize.Roslyn.v1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/publicize.roslyn/Vostok.Tools.Publicize.Roslyn.v1.dll
--------------------------------------------------------------------------------
/vostok.devtools/git-commit-to-assembly-title/Vostok.Tools.GitCommit2AssemblyTitle.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skbkontur/results/HEAD/vostok.devtools/git-commit-to-assembly-title/Vostok.Tools.GitCommit2AssemblyTitle.dll
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/push-to-nuget.cmd:
--------------------------------------------------------------------------------
1 | rmdir /S /Q nupkg
2 | nuget pack pack.nuspec -OutputDirectory nupkg
3 | nuget push nupkg\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey %1
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/push-to-nuget.cmd:
--------------------------------------------------------------------------------
1 | rmdir /S /Q nupkg
2 | nuget pack pack.nuspec -OutputDirectory nupkg
3 | nuget push nupkg\*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey %1
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/IStringFaultConsumer.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Inheritance
2 | {
3 | public interface IStringFaultConsumer
4 | {
5 | public void Consume(StringFault data);
6 | }
7 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Methods/IDescriptionProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods
2 | {
3 | internal interface IDescriptionProvider
4 | {
5 | MethodsDescription Get();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Results/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,vb}]
2 |
3 | dotnet_diagnostic.CA2225.severity = none
4 |
5 | dotnet_code_quality.CA1716.analyzed_symbol_kinds = Namespace, Method, Property, Event, Parameter
6 |
7 | dotnet_diagnostic.S3453.severity = none
8 |
9 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/CompilationUnit.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp.Syntax;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code
4 | {
5 | internal record CompilationUnit(string Hint, CompilationUnitSyntax Content);
6 | }
7 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/src/TemplateDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace launchpad
2 | {
3 | internal class TemplateDefinition
4 | {
5 | public string Name { get; set; }
6 |
7 | public string PackageName { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/src/VariableDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace launchpad
2 | {
3 | internal class VariableDefinition
4 | {
5 | public string Name { get; set; }
6 |
7 | public string Description { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/{{ProjectName}}/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("{{ProjectName}}.Tests")]
4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/{{ProjectName}}/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("{{ProjectName}}.Tests")]
4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
--------------------------------------------------------------------------------
/vostok.devtools/publicize.roslyn/Vostok.Tools.Publicize.Roslyn/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 |
3 | [assembly: InternalsVisibleTo("Vostok.Tools.Publicize.Roslyn.Tests")]
4 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
--------------------------------------------------------------------------------
/vostok.devtools/library-common-props/Test-Project-new.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | enable
7 | latest
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/CompilationFileProviderSettings.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code
2 | {
3 | internal record CompilationFileProviderSettings(
4 | string GlobalExtensionsFileName,
5 | string LocalExtensionsFileName);
6 | }
7 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/src/LaunchpadSpec.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace launchpad
4 | {
5 | internal class LaunchpadSpec
6 | {
7 | [JsonProperty("Variables")]
8 | public VariableDefinition[] Variables { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/StringFault.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Inheritance
2 | {
3 | public class StringFault : StringFaultBase
4 | {
5 | public StringFault(string fault)
6 | : base(fault)
7 | {
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/Code/Methods/Conversion/Combinations/Then/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Combinations.Then
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string Then = "Then";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/IConstantProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
2 | {
3 | internal interface IConstantProvider
4 | {
5 | TValue Get();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Results/.globalconfig:
--------------------------------------------------------------------------------
1 | is_global=true
2 |
3 | dotnet_diagnostic.CA1062.severity = none
4 |
5 | dotnet_diagnostic.SA0001.severity = none
6 |
7 | dotnet_diagnostic.SA1200.severity = none
8 |
9 | dotnet_diagnostic.SA1633.severity = none
10 |
11 | dotnet_diagnostic.S3903.severity = none
12 |
--------------------------------------------------------------------------------
/Kontur.Results.Monad/.globalconfig:
--------------------------------------------------------------------------------
1 | is_global=true
2 |
3 | dotnet_diagnostic.CA1062.severity = none
4 |
5 | dotnet_diagnostic.SA0001.severity = none
6 |
7 | dotnet_diagnostic.SA1200.severity = none
8 |
9 | dotnet_diagnostic.SA1633.severity = none
10 |
11 | dotnet_diagnostic.S3903.severity = none
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/Code/Methods/Conversion/Combinations/OrElse/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Combinations.OrElse
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string OrElse = "OrElse";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/StringFaultChild.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Inheritance
2 | {
3 | public sealed class StringFaultChild : StringFault
4 | {
5 | public StringFaultChild(string fault)
6 | : base(fault)
7 | {
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/vostok.devtools/library-common-props/Main-Project-app.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | net6.0
7 | net6.0
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/Code/Methods/Conversion/Combinations/Linq/Where/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Combinations.Linq.Where
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string Where = "Where";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/Code/Methods/Conversion/Combinations/Linq/Select/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Combinations.Linq.Select
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string Select = "Select";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/MethodTypeGeneratorParameter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp.Syntax;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code.Internal
4 | {
5 | internal record MethodTypeGeneratorParameter(
6 | SimpleNameSyntax UpperBound,
7 | bool Sealed);
8 | }
9 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/IntConstantProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
2 | {
3 | internal class IntConstantProvider : IConstantProvider
4 | {
5 | public int Get() => 8888;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/ValueTaskFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace Kontur.Tests.Results
4 | {
5 | internal static class ValueTaskFactory
6 | {
7 | internal static ValueTask Create(T result)
8 | {
9 | return new(result);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/Code/Methods/Conversion/Combinations/Linq/SelectMany/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Combinations.Linq.SelectMany
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string SelectMany = "SelectMany";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator/Code/Methods/Conversion/Map/MethodNames.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code.Methods.Conversion.Map
2 | {
3 | internal static class MethodNames
4 | {
5 | internal const string MapFault = "MapFault";
6 | internal const string MapValue = "MapValue";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValuePlain/IFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValuePlain
4 | {
5 | internal interface IFixtureCase
6 | {
7 | public Result GetResult(int value);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/IConstantProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
2 | {
3 | internal interface IConstantProvider
4 | {
5 | string GetError();
6 |
7 | TValue GetValue();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/{{ProjectName}}/SampleClass.cs:
--------------------------------------------------------------------------------
1 | using JetBrains.Annotations;
2 |
3 | namespace {{ProjectName}}
4 | {
5 | ///
6 | /// A sample class.
7 | ///
8 | [PublicAPI]
9 | internal class SampleClass
10 | {
11 |
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ResultFailedException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public class ResultFailedException : InvalidOperationException
6 | {
7 | internal ResultFailedException(string message)
8 | : base(message)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ValueExistsException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public class ValueExistsException : InvalidOperationException
6 | {
7 | internal ValueExistsException(string message)
8 | : base(message)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/SuccessMarker.TValue.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public sealed class SuccessMarker
4 | {
5 | internal SuccessMarker(TValue value)
6 | {
7 | this.Value = value;
8 | }
9 |
10 | internal TValue Value { get; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/UnreachableException.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace Kontur.Tests.Results
4 | {
5 | internal class UnreachableException : AssertionException
6 | {
7 | public UnreachableException()
8 | : base("Branch should be unreachable")
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ResultSucceedException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public class ResultSucceedException : InvalidOperationException
6 | {
7 | internal ResultSucceedException(string message)
8 | : base(message)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/LibraryException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Tests.Results.LibraryNamespace
4 | {
5 | internal static class LibraryException
6 | {
7 | internal const string Message = "Overriden";
8 |
9 | internal static Exception Instance => new(Message);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/MethodGenericParameterDescription.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code
5 | {
6 | internal record MethodGenericParameterDescription(
7 | SyntaxToken Identifier,
8 | TypeSyntax? UpperBound);
9 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ValueMissingException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public sealed class ValueMissingException : InvalidOperationException
6 | {
7 | internal ValueMissingException(string message)
8 | : base(message)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/vostok.devtools/code-style-csharp/.editorconfig:
--------------------------------------------------------------------------------
1 | ; 4-column space indentation
2 | [*]
3 | indent_style = space
4 |
5 | [*.{cs,tt}]
6 | indent_size = 4
7 |
8 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
9 | indent_size = 2
10 |
11 | [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
12 | indent_size = 2
13 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/MethodTypeGenericParameter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Internal
5 | {
6 | internal record MethodTypeGenericParameter(
7 | SyntaxToken Identifier,
8 | TypeSyntax? UpperBound);
9 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Parameters.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code
2 | {
3 | internal static class Parameters
4 | {
5 | internal static readonly SelfParameter SelfResultIdentifier = new("result");
6 | internal static readonly SelfParameter SelfOptionalIdentifier = new("optional");
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Containers/Plain/IContainer.T.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Diagnostics.Contracts;
3 |
4 | namespace Kontur.Results.Containers.Plain
5 | {
6 | internal interface IContainer
7 | {
8 | [Pure]
9 | bool TryGet([MaybeNullWhen(false)] out T data);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/MethodTypeInternal2.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp.Syntax;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code.Internal
4 | {
5 | internal record MethodTypeInternal2(
6 | InternalTypeParameter Parameter1,
7 | InternalTypeParameter Parameter2,
8 | TypeSyntax ReturnType);
9 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/InternalMethodsDescription.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code.Internal
4 | {
5 | internal record InternalMethodsDescription(
6 | IEnumerable Methods,
7 | InternalPartialMethodDescription Partial);
8 | }
9 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/InternalTypeParameter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp.Syntax;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code.Internal
4 | {
5 | internal record InternalTypeParameter(
6 | SimpleNameSyntax Type,
7 | bool IsTaskLike,
8 | MethodTypeGenericParameter? Generic);
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Optional/IOptional.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace Kontur.Results
5 | {
6 | [EditorBrowsable(EditorBrowsableState.Never)]
7 | public interface IOptional
8 | {
9 | internal TResult Match(Func onNone, Func onSome);
10 | }
11 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/IResult.TFault.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace Kontur.Results
5 | {
6 | [EditorBrowsable(EditorBrowsableState.Never)]
7 | public interface IResult
8 | {
9 | internal TResult Match(Func onFailure, Func onSuccess);
10 | }
11 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/IFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
4 | {
5 | internal interface IFixtureCase
6 | {
7 | public Optional GetOptional(TValue value, TValue constant);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/Select/DifferentTypes/StringConstantProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional.Select.DifferentTypes
2 | {
3 | internal class StringConstantProvider : IConstantProvider
4 | {
5 | public string Get() => "constant";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValuePlain/SuccessFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValuePlain
4 | {
5 | internal class SuccessFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(int value) => Result.Succeed();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/IFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal interface IFixtureCase
6 | {
7 | public Result GetResult(TValue value, IConstantProvider provider);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Actions/OnFailure/OnNoneExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class OnNoneExtensions
6 | {
7 | public static Optional OnNone(this IOptional optional, Action action)
8 | {
9 | return optional.Switch(action, () => { });
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/src/LaunchpadConfig.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace launchpad
4 | {
5 | internal class LaunchpadConfig
6 | {
7 | [JsonProperty("Definitions")]
8 | public TemplateDefinition[] Definitions { get; set; }
9 |
10 | [JsonProperty("NugetSources")]
11 | public string[] NugetSources { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/InternalPartialMethodDescription.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Internal
5 | {
6 | internal record InternalPartialMethodDescription(
7 | string ClassName,
8 | IEnumerable Methods);
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Methods/MethodsDescription.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results.SourceGenerator.Code.Internal;
2 | using Kontur.Results.SourceGenerator.Code.Public;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Methods
5 | {
6 | internal record MethodsDescription(
7 | InternalMethodsDescription Internal,
8 | PublicMethodsDescription Public);
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/EnsureNoneExtensions.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.LibraryNamespace
4 | {
5 | internal static class EnsureNoneExtensions
6 | {
7 | public static void EnsureNone(this Optional optional)
8 | {
9 | optional.EnsureNone(LibraryException.Instance);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValuePlain/FailureConstantFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValuePlain
4 | {
5 | internal class FailureConstantFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(int value) => Result.Fail("in the end");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValuePlain/FailureVariableFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValuePlain
4 | {
5 | internal class FailureVariableFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(int value) => ResultFactory.CreateFailure(value);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/EnsureHasValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.LibraryNamespace
4 | {
5 | internal static class EnsureHasValueExtensions
6 | {
7 | public static void EnsureHasValue(this Optional optional)
8 | {
9 | optional.EnsureHasValue(LibraryException.Instance);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/MethodTypeInternal3.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp.Syntax;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code.Internal
4 | {
5 | internal record MethodTypeInternal3(
6 | InternalTypeParameter Parameter1,
7 | InternalTypeParameter ParameterNext,
8 | InternalTypeParameter Parameter2,
9 | TypeSyntax ReturnType);
10 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Public/PublicMethodsDescription.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Public
5 | {
6 | internal record PublicMethodsDescription(
7 | IEnumerable Extensions,
8 | IEnumerable ExtensionsGlobal);
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Actions/OnSuccess/OnSuccessResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class OnSuccessResultPlainExtensions
6 | {
7 | public static Result OnSuccess(this IResult result, Action action)
8 | {
9 | return result.Switch(() => { }, action);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/NoneFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
4 | {
5 | internal class NoneFixtureCase : IFixtureCase
6 | {
7 | public Optional GetOptional(TValue value, TValue constant) => Optional.None();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator/ExtensionsSourceGenerator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 |
3 | namespace Kontur.Results.SourceGenerator
4 | {
5 | [Generator]
6 | public class ExtensionsSourceGenerator : SourceGeneratorBase
7 | {
8 | public ExtensionsSourceGenerator()
9 | : base(new("KonturResultGlobalExtensions", "KonturResultExtensions"))
10 | {
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/SomeFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
4 | {
5 | internal class SomeFixtureCase : IFixtureCase
6 | {
7 | public Optional GetOptional(TValue value, TValue constant) => Optional.Some(value);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ValueExistsException.TValue.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public sealed class ValueExistsException : ValueExistsException
4 | {
5 | internal ValueExistsException(TValue value, string message)
6 | : base(message)
7 | {
8 | this.Value = value;
9 | }
10 |
11 | public TValue Value { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Monad/MonadSourceGenerator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 |
3 | namespace Kontur.Results.SourceGenerator.Monad
4 | {
5 | [Generator]
6 | public class MonadSourceGenerator : SourceGeneratorBase
7 | {
8 | public MonadSourceGenerator()
9 | : base(new("KonturResultMonadGlobalExtensions", "KonturResultMonadExtensions"))
10 | {
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/ClassNamesPass.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results.SourceGenerator.Code
2 | {
3 | internal class ClassNamesPass : ClassNamesFactory
4 | {
5 | internal ClassNamesPass(string methodName, string parameterTypes)
6 | : base(methodName, parameterTypes)
7 | {
8 | }
9 |
10 | internal string Pass => this.Create(nameof(this.Pass));
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Public/MethodType2.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Public
5 | {
6 | internal record MethodType2(
7 | SimpleNameSyntax Parameter1,
8 | SimpleNameSyntax Parameter2,
9 | IEnumerable GenericArguments,
10 | TypeSyntax ReturnType);
11 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ResultFailedException.TFault.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public sealed class ResultFailedException : ResultFailedException
4 | {
5 | internal ResultFailedException(TFault fault, string message)
6 | : base(message)
7 | {
8 | this.Fault = fault;
9 | }
10 |
11 | public TFault Fault { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/Extraction/TryGet/Common.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 |
3 | namespace Kontur.Tests.Results.Inheritance.Extraction.TryGet
4 | {
5 | internal static class Common
6 | {
7 | internal static TestCaseData CreateReturnBooleanCase(StringFaultResult result, bool success)
8 | {
9 | return new(result) { ExpectedResult = success };
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/ResultSucceedException.TValue.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Results
2 | {
3 | public sealed class ResultSucceedException : ResultSucceedException
4 | {
5 | internal ResultSucceedException(TValue value, string message)
6 | : base(message)
7 | {
8 | this.Value = value;
9 | }
10 |
11 | public TValue Value { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Extraction/TryGet/Plain/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Extraction.TryGet.Plain
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateReturnBooleanCase(Result result, bool success)
9 | {
10 | return new(result) { ExpectedResult = success };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/SomeConstantFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
4 | {
5 | internal class SomeConstantFixtureCase : IFixtureCase
6 | {
7 | public Optional GetOptional(TValue value, TValue constant) => Optional.Some(constant);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/Select/DifferentTypes/StringConstantProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue.Select.DifferentTypes
2 | {
3 | internal class StringConstantProvider : IConstantProvider
4 | {
5 | public string GetError() => this.GetValue();
6 |
7 | public string GetValue() => "constant";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Extraction/TryGet/TValue/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Extraction.TryGet.TValue
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateReturnBooleanCase(Result result, bool success)
9 | {
10 | return new(result) { ExpectedResult = success };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Internal/InternalStandardMethodsDescription.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Internal
5 | {
6 | internal record InternalStandardMethodsDescription(
7 | string ClassName,
8 | IEnumerable Using,
9 | IEnumerable Methods);
10 | }
--------------------------------------------------------------------------------
/vostok.devtools/configure-await-false/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 |
3 | dotnet build -c Release
4 |
5 | dotnet tool install --add-source nupkg -g configureawaitfalse
6 |
7 | Usage example:
8 |
9 | configureawaitfalse
10 | Recursively scans all *.cs files in given and prints any 'await' expressions
11 | without ConfigureAwait(false). Fails in the end if any incorrect awaits were found.
12 |
13 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/ResultFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 | using Kontur.Results;
3 |
4 | namespace Kontur.Tests.Results.Conversion.Combinations
5 | {
6 | internal static class ResultFactory
7 | {
8 | internal static Result CreateFailure(int value)
9 | {
10 | return Result.Fail(value.ToString(CultureInfo.InvariantCulture));
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Extraction/TryGet/Optional/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Extraction.TryGet.Optional
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateReturnBooleanCase(Optional optional, bool success)
9 | {
10 | return new(optional) { ExpectedResult = success };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/vostok.devtools/dotnetprojectorderer/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 |
3 | dotnet build
4 |
5 | dotnet tool install --add-source nupkg -g dotnetprojectorderer
6 |
7 | Usage examples:
8 |
9 | dotnetprojectorderer - return projects in topological sort order relative to their dependencies.
10 |
11 | dotnetprojectorderer - return projects in topological sort order relative to their dependencies in .
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Conversion/Upcast/UpcastResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class UpcastResultPlainExtensions
6 | {
7 | [Pure]
8 | public static Result Upcast(this IResult result)
9 | {
10 | return result.Match(Result.Fail, Result.Succeed);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Conversion/Upcast/UpcastOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class UpcastOptionalExtensions
6 | {
7 | [Pure]
8 | public static Optional Upcast(this IOptional optional)
9 | {
10 | return optional.Match(Optional.None, Optional.Some);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/IntConstantProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal class IntConstantProvider : IConstantProvider
6 | {
7 | public string GetError() => this.GetValue().ToString(CultureInfo.InvariantCulture);
8 |
9 | public int GetValue() => 9999;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/module.yaml:
--------------------------------------------------------------------------------
1 | notests *default:
2 | build:
3 | target: {{ProjectName}}.sln
4 | configuration: NoTests
5 | tool:
6 | name: dotnet
7 |
8 | install:
9 | - {{ProjectName}}/bin/Release/netstandard2.0/{{ProjectName}}.dll
10 |
11 | deps:
12 | - vostok.devtools
13 |
14 | full-build > notests:
15 | build:
16 | target: {{ProjectName}}.sln
17 | configuration: Release
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrDefault/Fault/GetFaultOrDefaultResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetFaultOrDefaultResultPlainExtensions
6 | {
7 | [Pure]
8 | public static TFault? GetFaultOrDefault(this IResult result)
9 | {
10 | return result.GetFaultOrElse(default(TFault));
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrDefault/Value/GetValueOrDefaultOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetValueOrDefaultOptionalExtensions
6 | {
7 | [Pure]
8 | public static TValue? GetValueOrDefault(this IOptional optional)
9 | {
10 | return optional.GetValueOrElse(default(TValue));
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Containers/ResultValue/IContainer.TFault.TValue.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Diagnostics.Contracts;
3 |
4 | namespace Kontur.Results.Containers.ResultValue
5 | {
6 | internal interface IContainer
7 | {
8 | [Pure]
9 | bool TryGet(
10 | [MaybeNullWhen(false)] out TValue value,
11 | [MaybeNullWhen(true)] out TFault fault);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/FailureConstantFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal class FailureConstantFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(TValue value, IConstantProvider provider) => Result.Fail("in the end");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/vostok.devtools/dotnetversionsuffix/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 |
3 | dotnet build
4 |
5 | dotnet tool install --add-source nupkg -g dotnetversionsuffix
6 |
7 | Usage example:
8 |
9 | dotnetversionsuffix pre0000001 - sets given version suffix for all projects included in current directory's solutions.
10 |
11 | dotnetversionsuffix pre0000001 vostok.devtools - sets given version suffix for all projects included in given directory's solutions.
--------------------------------------------------------------------------------
/vostok.devtools/tcs-create-options/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 |
3 | dotnet build -c Release
4 |
5 | dotnet tool install --add-source nupkg -g tcscreateoptions
6 |
7 | Usage example:
8 |
9 | tcscreateoptions
10 | Recursively scans all *.cs files in given and prints any 'TaskCompletionSource' creations
11 | without configured 'TaskCreationOptions'. Fails in the end if any incorrect creations were found.
12 |
13 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/AccessModifierFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Microsoft.CodeAnalysis;
3 | using Microsoft.CodeAnalysis.CSharp;
4 |
5 | namespace Kontur.Results.SourceGenerator.Code
6 | {
7 | internal static class AccessModifierFactory
8 | {
9 | internal static SyntaxToken[] Create(params SyntaxKind[] tokens)
10 | {
11 | return tokens.Select(SyntaxFactory.Token).ToArray();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/SuccessVariableFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal class SuccessVariableFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(TValue value, IConstantProvider provider)
8 | => Result.Succeed(value);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/StringFaultResult.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Inheritance
2 | {
3 | public static class StringFaultResult
4 | {
5 | public static StringFaultResult Fail(StringFault fault)
6 | {
7 | return new(fault);
8 | }
9 |
10 | public static StringFaultResult Succeed(TValue value)
11 | {
12 | return new(value);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Instantiation/Plain/Create_Via_Non_Generic/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Instantiation.Plain.Create_Via_Non_Generic
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateSuccessCase(Result result, bool success)
9 | {
10 | return new(result) { ExpectedResult = success };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/vostok.devtools/library-ci/github_ci.yml:
--------------------------------------------------------------------------------
1 | name: Build & Test & Publish
2 |
3 | on: [push, workflow_dispatch]
4 |
5 | jobs:
6 | build:
7 | uses: vostok/github.ci/.github/workflows/build.yml@master
8 |
9 | test:
10 | needs: build
11 | uses: vostok/github.ci/.github/workflows/test.yml@master
12 |
13 | publish:
14 | needs: test
15 | uses: vostok/github.ci/.github/workflows/publish.yml@master
16 | secrets:
17 | token: ${{ secrets.NUGET_TOKEN }}
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrDefault/Fault/GetFaultOrDefaultResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetFaultOrDefaultResultValueExtensions
6 | {
7 | [Pure]
8 | public static TFault? GetFaultOrDefault(this IResult result)
9 | {
10 | return result.GetFaultOrElse(default(TFault));
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrDefault/Value/GetValueOrDefaultResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetValueOrDefaultResultValueExtensions
6 | {
7 | [Pure]
8 | public static TValue? GetValueOrDefault(this IResult result)
9 | {
10 | return result.GetValueOrElse(default(TValue));
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/ClassNamesPassExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis.CSharp;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code
5 | {
6 | internal static class ClassNamesPassExtensions
7 | {
8 | internal static IdentifierNameSyntax PassNameSyntax(this ClassNamesPass classNames)
9 | {
10 | return SyntaxFactory.IdentifierName(classNames.Pass);
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/FailureVariableFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal class FailureVariableFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(TValue value, IConstantProvider provider) =>
8 | Result.Fail(provider.GetError());
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Conversion/Upcast/UpcastResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class UpcastResultValueExtensions
6 | {
7 | [Pure]
8 | public static Result Upcast(this IResult result)
9 | {
10 | return result.Match(Result.Fail, Result.Succeed);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/SuccessConstantFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
4 | {
5 | internal class SuccessConstantFixtureCase : IFixtureCase
6 | {
7 | public Result GetResult(TValue value, IConstantProvider provider)
8 | => Result.Succeed(provider.GetValue());
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Instantiation/Optional/Create_Via_Non_Generic/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Instantiation.Optional.Create_Via_Non_Generic
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateHasValueCase(Optional optional, bool hasValue)
9 | {
10 | return new(optional) { ExpectedResult = hasValue };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Instantiation/TValue/Create_Via_Non_Generic/Common.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Instantiation.TValue.Create_Via_Non_Generic
5 | {
6 | internal static class Common
7 | {
8 | internal static TestCaseData CreateHasValueCase(Result result, bool success)
9 | {
10 | return new(result) { ExpectedResult = success };
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/UpcastPlainExample.TResult.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results
4 | {
5 | internal class UpcastPlainExample
6 | {
7 | internal UpcastPlainExample(Result source, TResult result)
8 | {
9 | this.Source = source;
10 | this.Result = result;
11 | }
12 |
13 | internal Result Source { get; }
14 |
15 | internal TResult Result { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/vostok.devtools/dotnetprojectrefs/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 |
3 | dotnet build
4 |
5 | dotnet tool install --add-source nupkg -g dotnetprojectrefs
6 |
7 | Usage examples:
8 |
9 | dotnetprojectrefs - converts project references to nuget package references (with same version) for all solutions in current directory.
10 |
11 | dotnetprojectrefs - converts project references to nuget package references (with same version) for all solutions in .
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Enumerator/GetEnumeratorOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 |
4 | namespace Kontur.Results
5 | {
6 | public static class GetEnumeratorOptionalExtensions
7 | {
8 | [Pure]
9 | public static IEnumerator GetEnumerator(this IOptional optional)
10 | {
11 | return optional.GetValues().GetEnumerator();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrNull/Fault/GetFaultOrNullResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetFaultOrNullResultPlainExtensions
6 | {
7 | [Pure]
8 | public static TFault? GetFaultOrNull(this IResult result)
9 | where TFault : struct
10 | {
11 | return result.Match(fault => fault, () => null);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrNull/Value/GetValueOrNullOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetValueOrNullOptionalExtensions
6 | {
7 | [Pure]
8 | public static TValue? GetValueOrNull(this IOptional optional)
9 | where TValue : struct
10 | {
11 | return optional.Match(() => null, value => value);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/LibraryNamespace/GetValueOrThrowOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using JetBrains.Annotations;
2 | using Kontur.Results;
3 |
4 | namespace Kontur.Tests.Results.LibraryNamespace
5 | {
6 | internal static class GetValueOrThrowOptionalExtensions
7 | {
8 | [Pure]
9 | public static CustomValue GetValueOrThrow(this IOptional optional)
10 | {
11 | return optional.GetValueOrThrow(LibraryException.Instance);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Public/MethodType3.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Public
5 | {
6 | internal record MethodType3(
7 | SimpleNameSyntax Parameter1,
8 | SimpleNameSyntax ParameterNext,
9 | bool ParameterNextIsTask,
10 | SimpleNameSyntax Parameter2,
11 | IEnumerable GenericArguments,
12 | TypeSyntax ReturnType);
13 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Inheritance/UpcastExample.TValue.TResult.cs:
--------------------------------------------------------------------------------
1 | namespace Kontur.Tests.Results.Inheritance
2 | {
3 | internal class UpcastExample
4 | {
5 | internal UpcastExample(StringFaultResult source, TResult result)
6 | {
7 | this.Source = source;
8 | this.Result = result;
9 | }
10 |
11 | internal StringFaultResult Source { get; }
12 |
13 | internal TResult Result { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/UpcastOptionalExample.TResult.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results
4 | {
5 | internal class UpcastOptionalExample
6 | {
7 | internal UpcastOptionalExample(Optional optional, TResult result)
8 | {
9 | this.Optional = optional;
10 | this.Result = result;
11 | }
12 |
13 | internal Optional Optional { get; }
14 |
15 | internal TResult Result { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Enumerator/GetEnumeratorResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 |
4 | namespace Kontur.Results
5 | {
6 | public static class GetEnumeratorResultValueExtensions
7 | {
8 | [Pure]
9 | public static IEnumerator GetEnumerator(this IResult result)
10 | {
11 | return result.GetValues().GetEnumerator();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrNull/Fault/GetFaultOrNullResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetFaultOrNullResultValueExtensions
6 | {
7 | [Pure]
8 | public static TFault? GetFaultOrNull(this IResult result)
9 | where TFault : struct
10 | {
11 | return result.Match(fault => fault, () => null);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/OrNull/Value/GetValueOrNullResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class GetValueOrNullResultValueExtensions
6 | {
7 | [Pure]
8 | public static TValue? GetValueOrNull(this IResult result)
9 | where TValue : struct
10 | {
11 | return result.Match(() => null, value => value);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Optional/Some.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | internal sealed class Some : Optional
6 | {
7 | private readonly TValue value;
8 |
9 | internal Some(TValue value)
10 | {
11 | this.value = value;
12 | }
13 |
14 | public override TResult Match(Func onNone, Func onSome)
15 | {
16 | return onSome(this.value);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Faults/GetFaultsResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 | using System.Linq;
4 |
5 | namespace Kontur.Results
6 | {
7 | public static class GetFaultsResultPlainExtensions
8 | {
9 | [Pure]
10 | public static IEnumerable GetFaults(this IResult result)
11 | {
12 | return result.Match(fault => new[] { fault }, Enumerable.Empty);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Values/GetValuesOptionalExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 | using System.Linq;
4 |
5 | namespace Kontur.Results
6 | {
7 | public static class GetValuesOptionalExtensions
8 | {
9 | [Pure]
10 | public static IEnumerable GetValues(this IOptional optional)
11 | {
12 | return optional.Match(Enumerable.Empty, value => new[] { value });
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/Optional/SelectCaseToTestCasesExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.Optional
5 | {
6 | internal static class SelectCaseToTestCasesExtensions
7 | {
8 | internal static IEnumerable ToTestCases(this IEnumerable cases)
9 | {
10 | return cases.ToTestCases(option => option);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Build & Test & Publish
2 |
3 | on: [push, pull_request, workflow_dispatch]
4 |
5 | jobs:
6 | build:
7 | uses: vostok/github.ci/.github/workflows/build.yml@master
8 |
9 | test:
10 | needs: build
11 | uses: vostok/github.ci/.github/workflows/test.yml@master
12 |
13 | publish:
14 | needs: test
15 | uses: vostok/github.ci/.github/workflows/publish.yml@master
16 | secrets:
17 | token: $\{{ secrets.NUGET_TOKEN }}
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | name: Build & Test & Publish
2 |
3 | on: [push, pull_request, workflow_dispatch]
4 |
5 | jobs:
6 | build:
7 | uses: vostok/github.ci/.github/workflows/build.yml@master
8 |
9 | test:
10 | needs: build
11 | uses: vostok/github.ci/.github/workflows/test.yml@master
12 |
13 | publish:
14 | needs: test
15 | uses: vostok/github.ci/.github/workflows/publish.yml@master
16 | secrets:
17 | token: $\{{ secrets.NUGET_TOKEN }}
--------------------------------------------------------------------------------
/Kontur.Tests.Results/UpcastTValueExample.TFault.TValue.TResult.cs:
--------------------------------------------------------------------------------
1 | using Kontur.Results;
2 |
3 | namespace Kontur.Tests.Results
4 | {
5 | internal class UpcastTValueExample
6 | {
7 | internal UpcastTValueExample(Result source, TResult result)
8 | {
9 | this.Source = source;
10 | this.Result = result;
11 | }
12 |
13 | internal Result Source { get; }
14 |
15 | internal TResult Result { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/module.yaml:
--------------------------------------------------------------------------------
1 | src:
2 | build:
3 | target: None
4 | configuration: None
5 |
6 | notests *default:
7 | build:
8 | target: {{ProjectName}}.sln
9 | configuration: NoTests
10 | tool:
11 | name: dotnet
12 |
13 | install:
14 | - {{ProjectName}}/bin/Release/netstandard2.0/{{ProjectName}}.dll
15 |
16 | deps:
17 | - vostok.devtools
18 |
19 | full-build > notests:
20 | build:
21 | target: {{ProjectName}}.sln
22 | configuration: Release
23 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/TaskLikeTypeSyntaxFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code
5 | {
6 | internal static class TaskLikeTypeSyntaxFactory
7 | {
8 | internal static IEnumerable Create(TypeSyntax argument)
9 | {
10 | yield return TypeFactory.CreateTask(argument);
11 | yield return TypeFactory.CreateValueTask(argument);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Values/GetValuesResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 | using System.Linq;
4 |
5 | namespace Kontur.Results
6 | {
7 | public static class GetValuesResultValueExtensions
8 | {
9 | [Pure]
10 | public static IEnumerable GetValues(this IResult result)
11 | {
12 | return result.Match(Enumerable.Empty, value => new[] { value });
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Get/Faults/GetFaultsResultValueExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.Contracts;
3 | using System.Linq;
4 |
5 | namespace Kontur.Results
6 | {
7 | public static class GetFaultsResultValueExtensions
8 | {
9 | [Pure]
10 | public static IEnumerable GetFaults(this IResult result)
11 | {
12 | return result.Match(fault => new[] { fault }, Enumerable.Empty);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad/launchpad-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "NugetSources": [
3 | "https://api.nuget.org/v3/index.json"
4 | ],
5 | "Definitions": [
6 | {
7 | "Name": "vostok-library",
8 | "PackageName": "Vostok.Launchpad.Templates.Library"
9 | },
10 | {
11 | "Name": "vostok-source-library",
12 | "PackageName": "Vostok.Launchpad.Templates.SourceLibrary"
13 | },
14 | {
15 | "Name": "vostok-legacy-library",
16 | "PackageName": "Vostok.Launchpad.Templates.LegacyLibrary"
17 | }
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/IMethodBodyFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis;
3 | using Microsoft.CodeAnalysis.CSharp.Syntax;
4 |
5 | namespace Kontur.Results.SourceGenerator.Code
6 | {
7 | internal interface IMethodBodyFactory
8 | {
9 | BlockSyntax CreateDelegateToOtherClass(
10 | SyntaxToken methodName,
11 | SimpleNameSyntax delegateClassName,
12 | IEnumerable genericArguments,
13 | IEnumerable arguments);
14 | }
15 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/SelfParameter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 | using Microsoft.CodeAnalysis.CSharp;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code
5 | {
6 | internal class SelfParameter
7 | {
8 | internal SelfParameter(string name)
9 | {
10 | this.Name = SyntaxFactory.Identifier(name);
11 | this.TaskName = SyntaxFactory.Identifier(name + "Task");
12 | }
13 |
14 | public SyntaxToken Name { get; }
15 |
16 | public SyntaxToken TaskName { get; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Containers/Plain/FilledContainer.T.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results.Containers.Plain
4 | {
5 | internal sealed class FilledContainer : IContainer
6 | {
7 | private readonly T stored;
8 |
9 | internal FilledContainer(T data)
10 | {
11 | this.stored = data;
12 | }
13 |
14 | [Pure]
15 | public bool TryGet(out T data)
16 | {
17 | data = this.stored;
18 | return true;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Optional/None.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | internal sealed class None : Optional
6 | {
7 | private static readonly Lazy> Provider = new(() => new());
8 |
9 | private None()
10 | {
11 | }
12 |
13 | internal static Optional Instance => Provider.Value;
14 |
15 | public override TResult Match(Func onNone, Func onSome)
16 | {
17 | return onNone();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/ResultFailure.TFault.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | internal sealed class ResultFailure : Result
6 | {
7 | private readonly TFault fault;
8 |
9 | internal ResultFailure(TFault fault)
10 | {
11 | this.fault = fault;
12 | }
13 |
14 | public override TResult Match(Func onFailure, Func onSuccess)
15 | {
16 | return onFailure(this.fault);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/ResultSuccess.TFault.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | internal sealed class ResultSuccess : Result
6 | {
7 | private readonly TValue value;
8 |
9 | internal ResultSuccess(TValue value)
10 | {
11 | this.value = value;
12 | }
13 |
14 | public override TResult Match(Func onFailure, Func onSuccess)
15 | {
16 | return onSuccess(this.value);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/EnumerableExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code
4 | {
5 | internal static class EnumerableExtensions
6 | {
7 | internal static IEnumerable WhereNotNull(this IEnumerable source)
8 | {
9 | foreach (var element in source)
10 | {
11 | if (element != null)
12 | {
13 | yield return element;
14 | }
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/ITypeParameterGenericMethodSyntaxGenerator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis.CSharp.Syntax;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code
5 | {
6 | internal interface ITypeParameterGenericMethodSyntaxGenerator
7 | {
8 | IEnumerable CreateTypeParameterConstraints(IEnumerable genericParameters);
9 |
10 | CompilationUnitSyntax FixMethodTypeParameterIndentation(CompilationUnitSyntax compilationUnit);
11 | }
12 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Actions/OnSuccess/OnSomeExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class OnSomeExtensions
6 | {
7 | public static Optional OnSome(this IOptional optional, Action action)
8 | {
9 | return optional.Switch(() => { }, action);
10 | }
11 |
12 | public static Optional OnSome(this IOptional optional, Action action)
13 | {
14 | return optional.OnSome(_ => action());
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/README.md:
--------------------------------------------------------------------------------
1 | # {{ProjectName}}
2 |
3 | [](https://github.com/vostok/{{RepositoryName}}/actions/workflows/ci.yml)
4 | [](https://www.nuget.org/packages/{{ProjectName}})
5 |
6 | {{OneLineDescription}}
7 |
8 |
9 | **Build guide**: https://github.com/vostok/devtools/blob/master/library-dev-conventions/how-to-build-a-library.md
10 |
11 | **User documentation**: not written yet.
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/README.md:
--------------------------------------------------------------------------------
1 | # {{ProjectName}}
2 |
3 | [](https://github.com/vostok/{{RepositoryName}}/actions/workflows/ci.yml)
4 | [](https://www.nuget.org/packages/{{ProjectName}})
5 |
6 | {{OneLineDescription}}
7 |
8 |
9 | **Build guide**: https://github.com/vostok/devtools/blob/master/library-dev-conventions/how-to-build-a-library.md
10 |
11 | **User documentation**: not written yet.
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/IdentifierExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 |
3 | namespace Kontur.Results.SourceGenerator.Code
4 | {
5 | internal static class IdentifierExtensions
6 | {
7 | internal static bool IsValueTask(this SyntaxToken identifier)
8 | {
9 | return identifier.IsEquivalentTo(Identifiers.ValueTaskIdentifier);
10 | }
11 |
12 | internal static bool IsTask(this SyntaxToken identifier)
13 | {
14 | return identifier.IsEquivalentTo(Identifiers.TaskIdentifier);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/IResult.TFault.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace Kontur.Results
5 | {
6 | [EditorBrowsable(EditorBrowsableState.Never)]
7 | public interface IResult
8 | {
9 | internal TResult Match(Func onFailure, Func onSuccess);
10 |
11 | internal TResult Match(Func onFailure, Func onSuccess);
12 |
13 | internal TResult Match(Func onFailure, Func onSuccess);
14 | }
15 | }
--------------------------------------------------------------------------------
/Kontur.Results/Extensions/Extraction/Actions/OnFailure/OnFailureResultPlainExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class OnFailureResultPlainExtensions
6 | {
7 | public static Result OnFailure(this IResult result, Action action)
8 | {
9 | return result.Switch(action, () => { });
10 | }
11 |
12 | public static Result OnFailure(this IResult result, Action action)
13 | {
14 | return result.OnFailure(_ => action());
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValue/SelectCaseToTestCasesExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Kontur.Tests.Results.Conversion.Combinations.Linq.Result.SelectCaseGenerators;
3 | using NUnit.Framework;
4 |
5 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValue
6 | {
7 | internal static class SelectCaseToTestCasesExtensions
8 | {
9 | internal static IEnumerable ToTestCases(this IEnumerable cases)
10 | {
11 | return cases.ToTestCases(result => result);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/vostok.devtools/vostok-release/readme.txt:
--------------------------------------------------------------------------------
1 | Installation for .NET Core 2.1+:
2 | - Windows: `install`
3 | - Non-windows: `./install.sh`
4 |
5 | Usage:
6 |
7 | 1. Update `CHANGELOG.md`: describe the changes you've made in the current release (see VersionPrefix in .csproj)
8 | 2. Run `vostok-release` in solution directory. It will do several things:
9 | * new tag with current release version will be created and pushed,
10 | * VersionPrefix in csproj will be incremented, Unshipped file rolled to Shipped, commited and pushed,
11 | * new package will be built and pushed to NuGet from GitHub Actions CI
12 |
--------------------------------------------------------------------------------
/vostok.devtools/library-common-props/Main-Project-new.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | enable
7 | latest
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/ResultSuccess.TValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | internal sealed class ResultSuccess : Result
6 | {
7 | private static readonly Lazy> Provider = new(() => new());
8 |
9 | private ResultSuccess()
10 | {
11 | }
12 |
13 | internal static Result Instance => Provider.Value;
14 |
15 | public override TResult Match(Func onFailure, Func onSuccess)
16 | {
17 | return onSuccess();
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Result/TValueTValue/LinqTestBase.TFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Result.TValueTValue
5 | {
6 | internal abstract class LinqTestBase : LinqTestBase
7 | where TFixtureCase : IFixtureCase, new()
8 | {
9 | protected static IEnumerable CreateSelectCases(int argumentsCount)
10 | {
11 | return CreateSelectCases(argumentsCount, x => x);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Kontur.Tests.Results/Conversion/Combinations/Linq/Optional/OptionalOptional/LinqTestBase.ITestFixtureCase.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using NUnit.Framework;
3 |
4 | namespace Kontur.Tests.Results.Conversion.Combinations.Linq.Optional.OptionalOptional
5 | {
6 | internal abstract class LinqTestBase : LinqTestBase
7 | where TFixtureCase : IFixtureCase, new()
8 | {
9 | protected static IEnumerable CreateSelectCases(int argumentsCount)
10 | {
11 | return CreateSelectCases(argumentsCount, x => x);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/vostok.devtools/module.yaml:
--------------------------------------------------------------------------------
1 | src:
2 | build:
3 | target: None
4 | configuration: None
5 |
6 | full-build:
7 | deps:
8 | - vostok.devtools.ilrepack.bin
9 | build:
10 | target: None
11 | configuration: None
12 |
13 | dotnetcementrefs:
14 | build:
15 | - name: Build
16 | tool: dotnet
17 | parameters: build
18 | target: dotnetcementrefs\dotnetcementrefs.sln
19 | configuration: Release
20 | - name: Install global tool
21 | tool: dotnet
22 | parameters: tool update --add-source dotnetcementrefs\nupkg -g dotnetcementrefs --
23 | target: plz_fix_none
24 | configuration: None
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Optional/Optional.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.Contracts;
2 |
3 | namespace Kontur.Results
4 | {
5 | public static class Optional
6 | {
7 | [Pure]
8 | public static NoneMarker None()
9 | {
10 | return default;
11 | }
12 |
13 | [Pure]
14 | public static Optional None()
15 | {
16 | return Optional.None();
17 | }
18 |
19 | [Pure]
20 | public static Optional Some(TValue value)
21 | {
22 | return Optional.Some(value);
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/vostok.devtools/dotnetcementrefs/dotnetcementrefs.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
--------------------------------------------------------------------------------
/.build_nuget.bat:
--------------------------------------------------------------------------------
1 | cd .\vostok.devtools\dotnetcementrefs
2 | dotnet build -c Release
3 | dotnet tool update --add-source nupkg -g dotnetcementrefs
4 |
5 | cd %~dp0
6 | dotnetcementrefs --source:https://api.nuget.org/v3/index.json --refPrefix:Kontur --ignoreMissingPackages --allowLocalProjects
7 |
8 | dotnet pack Kontur.Results\Kontur.Results.csproj
9 | dotnet nuget push .\Kontur.Results\bin\Release\*.nupkg --api-key %nugetapikey% --source https://api.nuget.org/v3/index.json
10 |
11 | dotnet pack Kontur.Results.Monad\Kontur.Results.Monad.csproj
12 | dotnet nuget push .\Kontur.Results.Monad\bin\Release\*.nupkg --api-key %nugetapikey% --source https://api.nuget.org/v3/index.json
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-source/template/{{ProjectName}}.Tests/{{ProjectName}}.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/vostok.devtools/git-commit-to-assembly-title/Vostok.Tools.GitCommit2AssemblyTitle.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | bin\
6 | obj\
7 | NETSDK1138
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/vostok.devtools/launchpad-templates/library-ordinary/template/{{ProjectName}}.Tests/{{ProjectName}}.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Kontur.Results.SourceGenerator.Shared/Code/Methods/MethodsDescriptionProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace Kontur.Results.SourceGenerator.Code.Methods
5 | {
6 | internal class MethodsDescriptionProvider
7 | {
8 | private readonly IEnumerable providers;
9 |
10 | public MethodsDescriptionProvider(IEnumerable providers)
11 | {
12 | this.providers = providers;
13 | }
14 |
15 | internal IEnumerable Get()
16 | {
17 | return this.providers.Select(provider => provider.Get());
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Kontur.Results/Implementation/Result/ResultFailure.T.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Kontur.Results
4 | {
5 | public sealed class ResultFailure