Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam committed May 19, 2023
0 parents commit 0e3cad0
Show file tree
Hide file tree
Showing 25 changed files with 1,155 additions and 0 deletions.
187 changes: 187 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 4

[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props,xml}]
indent_style = space
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]

# ---
# naming conventions
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions

# language conventions
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions

dotnet_sort_system_directives_first = true

# Style rules
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/naming-rules?view=vs-2017

# Constants always pascal case
dotnet_naming_rule.constants_should_be_pascal_case.symbols = consts
dotnet_naming_rule.constants_should_be_pascal_case.style = consts
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion

dotnet_naming_symbols.consts.applicable_kinds = field
dotnet_naming_symbols.consts.applicable_accessibilities = *
dotnet_naming_symbols.consts.required_modifiers = const

dotnet_naming_style.consts.capitalization = pascal_case

# Non-public static fields always pascal case
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.symbols = non_public_static_fields
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.style = non_public_static_fields
dotnet_naming_rule.non_public_static_fields_should_be_pascal_case.severity = suggestion

dotnet_naming_symbols.non_public_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_static_fields.applicable_accessibilities = private, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_public_static_fields.required_modifiers = static

dotnet_naming_style.non_public_static_fields.capitalization = pascal_case

# Non-private readonly fields are pascal case
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_fields

dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly

dotnet_naming_style.non_private_readonly_fields.capitalization = pascal_case

# Private instance fields are camel case prefixed underscore
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.style = private_fields
dotnet_naming_rule.private_fields_should_be_camelcase_prefix_underscore.severity = suggestion

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_style.private_fields.capitalization = camel_case
dotnet_naming_style.private_fields.required_prefix = _

# Locals and parameters are camel case
dotnet_naming_rule.locals.severity = suggestion
dotnet_naming_rule.locals.symbols = locals
dotnet_naming_rule.locals.style = locals

dotnet_naming_symbols.locals.applicable_kinds = parameter, local

dotnet_naming_style.locals.capitalization = camel_case

# Local functions are pascal case
dotnet_naming_rule.local_functions.severity = suggestion
dotnet_naming_rule.local_functions.symbols = local_functions
dotnet_naming_rule.local_functions.style = local_functions

dotnet_naming_symbols.local_functions.applicable_kinds = local_function

dotnet_naming_style.local_functions.capitalization = pascal_case

# Public members always pascal case
dotnet_naming_rule.public_members_should_be_pascal_case.symbols = public_members
dotnet_naming_rule.public_members_should_be_pascal_case.style = public_members
dotnet_naming_rule.public_members_should_be_pascal_case.severity = suggestion

dotnet_naming_symbols.public_members.applicable_kinds = property, method, field, event, delegate
dotnet_naming_symbols.public_members.applicable_accessibilities = public

dotnet_naming_style.public_members.capitalization = pascal_case

dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error

# Suggest more modern language features when available
dotnet_style_object_initializer = true:error
dotnet_style_collection_initializer = true:error
dotnet_style_explicit_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_coalesce_expression = true:error
dotnet_style_null_propagation = true:error

dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_readonly_field = true:error

# CSharp code style settings:
[*.cs]
trim_trailing_whitespace = true
insert_final_newline = true

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error

csharp_style_expression_bodied_methods = true:error
csharp_style_expression_bodied_constructors = true:error
csharp_style_expression_bodied_operators = true:error
csharp_style_expression_bodied_properties = true:error
csharp_style_expression_bodied_indexers = true:error
csharp_style_expression_bodied_accessors = true:error

csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error
csharp_style_inlined_variable_declaration = true:error
csharp_style_deconstructed_variable_declaration = true:error
csharp_style_pattern_local_over_anonymous_function = true:error
csharp_style_throw_expression = true:error
csharp_style_conditional_delegate_call = true:error

csharp_prefer_braces = false:warning
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:error

# formatting conventions
# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions

# newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

# indent
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false

# wrap
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true

# resharper
resharper_csharp_braces_for_lock = required_for_multiline
resharper_csharp_braces_for_using = required_for_multiline
resharper_csharp_braces_for_while = required_for_multiline
resharper_csharp_braces_for_foreach = required_for_multiline
resharper_csharp_braces_for_for = required_for_multiline
resharper_csharp_braces_for_fixed = required_for_multiline
resharper_csharp_braces_for_ifelse = required_for_multiline
resharper_csharp_accessor_owner_body = expression_body

[*.{sh,bat,ps1}]
trim_trailing_whitespace = true
insert_final_newline = true

[*.sh]
end_of_line = lf
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Auto detect text files and perform LF normalization
* text=auto eol=lf

# Set default behavior for command prompt diff.
# This gives output on command line taking C# language constructs into consideration (e.g showing class name)
*.cs text diff=csharp

# Set windows specific files explicitly to crlf line ending
*.cmd eol=crlf
*.bat eol=crlf
*.ps1 eol=crlf

# Mark files specifically as binary to avoid line ending conversion
*.snk binary
*.png binary
30 changes: 30 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Test
env:
PINECONE_APIKEY: ${{ secrets.PINECONE_APIKEY }}
PINECONE_INDEXNAME: ${{ secrets.PINECONE_INDEXNAME }}
PINECONE_ENVIRONMENT: ${{ secrets.PINECONE_ENVIRONMENT }}
PINECONE_PROJECTNAME: ${{ secrets.PINECONE_PROJECTNAME }}
run: ./build.sh test
shell: bash
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/

.idea
nuget
protos

*.sln.DotSettings.user

credentials.json
27 changes: 27 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Authors>Russ Cam</Authors>
<Copyright>Russ Cam</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryUrl>https://github.com/russcam/pinecone-dotnet-client</RepositoryUrl>
<PackageProjectUrl>https://github.com/russcam/pinecone-dotnet-client</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/russcam/pinecone-dotnet-client/releases</PackageReleaseNotes>
<PackageTags>pinecone, database, vector, search</PackageTags>
<PineconeVersion>V3.0.0rc2</PineconeVersion>
</PropertyGroup>
<PropertyGroup>
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>
<MinVerMinimumMajorMinor>0.1</MinVerMinimumMajorMinor>
<MinVerIgnoreHeight>true</MinVerIgnoreHeight>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IsPackable>False</IsPackable>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.3.0" PrivateAssets="all"/>
</ItemGroup>

</Project>
Loading

0 comments on commit 0e3cad0

Please sign in to comment.