Skip to content

Commit

Permalink
Merge to master. (#146)
Browse files Browse the repository at this point in the history
* New dev readme.

* Update to .net 7.

* Remove AppVeyor, SonarQube, StyleCop before moving to GH Actions.

* Create codeql.yml

* Delete codeql-analysis.yml

* Create sonar.yml

* Point readme status badges at new workflow.

* Delete more StyleCop.

* Fix case of Ansel.ged file not able to be found in Linux.

* Revert line feed tests as failing under Linux. Needs work for cross platform.

* Set up editorconfig standards.

* More cross platform path test fixes.

* Remove duplicated copyright noise text.

* Update sonar.yml

* Trigger build.

* Rework test.

* Trigger build.

* Fix test that break on Linux due to line terminators not being detected and preserved.

* Reverse linefeed changes so code does not care what they are.

* Fix another broken cross platform linefeed test.

* Tidy up environment newline detection.

* Fix issue with calendar not being recognised.

* Remove compile time generated documentation from source.

* Don't track JetBrains Rider IDE scratch files.

* Update test runner packages.

* Fixed some typos in comments and strings. (#124)

* Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.2 (#123)

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.5.0 to 17.6.2.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.5.0...v17.6.2)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Generate XML documentation files in output- instead of source-directory (#125)

* Fixed some typos in comments and strings.

* Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated.

* Store the record change dates that are read in from GED file (#126)

* Fixed some typos in comments and strings.

* Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated.

* Store the record change dates that are read in from GED file

* Bump Microsoft.NET.Test.Sdk from 17.6.2 to 17.6.3 (#127)

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.2 to 17.6.3.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.6.2...v17.6.3)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix exception when reading ChangeDate when file contains bad submitter reference. (#128)

* Fixed some typos in comments and strings.

* Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated.

* Store the record change dates that are read in from GED file

* Fix exception when reading ChangeDate when file contains bad submitter reference.

* Bump xunit from 2.4.2 to 2.5.0 (#129)

Bumps [xunit](https://github.com/xunit/xunit) from 2.4.2 to 2.5.0.
- [Commits](xunit/xunit@2.4.2...2.5.0)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ryan O'Neill <r@ryanoneill.com>

* Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#130)

Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](xunit/visualstudio.xunit@v2.4.5...2.5.0)

---
updated-dependencies:
- dependency-name: xunit.runner.visualstudio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ryan O'Neill <r@ryanoneill.com>

* Add support for custom records on event records. (#144)

* Fixed some typos in comments and strings.

* Generate XML documentation files in output- instead of source-directory. Remove them from repository as they are generated.

* Store the record change dates that are read in from GED file

* Fix exception when reading ChangeDate when file contains bad submitter reference.

* Add support for custom records on event records.

* Bump xunit from 2.5.0 to 2.6.0 (#141)

Bumps [xunit](https://github.com/xunit/xunit) from 2.5.0 to 2.6.0.
- [Commits](xunit/xunit@2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump xunit.runner.visualstudio from 2.5.0 to 2.5.3 (#138)

Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.0 to 2.5.3.
- [Release notes](https://github.com/xunit/visualstudio.xunit/releases)
- [Commits](xunit/visualstudio.xunit@2.5.0...2.5.3)

---
updated-dependencies:
- dependency-name: xunit.runner.visualstudio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ryan O'Neill <r@ryanoneill.com>

* Bump Microsoft.NET.Test.Sdk from 17.6.3 to 17.8.0 (#145)

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.6.3 to 17.8.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.6.3...v17.8.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update to .Net 8.

* Update all packages to latest.

* Attempt to fix Sonar Cloud analysis.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: mtx500 <ghub@memotech.franken.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 10, 2024
1 parent c046c58 commit 787ab8c
Show file tree
Hide file tree
Showing 59 changed files with 721 additions and 7,205 deletions.
102 changes: 88 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,95 @@
###############################
# Core EditorConfig Options #
###############################
root = true

# All files
[*]
indent_style = space
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = inside_namespace:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
dotnet_diagnostic.IDE0073.severity = error

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 4
# Xml files
[*.xml]
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 4
[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

# Code files
[*.{cs,csx,vb,vbx}]
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion

# License header
file_header_template = <copyright file="{fileName}" company="GeneGenie.com">\r\nCopyright (c) GeneGenie.com. All Rights Reserved.\r\nLicensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information.\r\n</copyright>
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,62 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [master]
branches: [ main, dev ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
branches: [ main, dev ]
schedule:
- cron: '0 8 * * 5'
- cron: '23 12 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['csharp']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
uses: actions/checkout@v3

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
- name: Setup .Net SDK (v7.0)
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +72,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
43 changes: 43 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: SonarCloud

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
types: [opened, synchronize, reopened]

jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
java-package: jdk # optional (jdk or jre) - defaults to jdk

- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Setup .Net SDK (v8.0)
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Install dotnet global tools
run: |
dotnet tool install --global dotnet-coverage
dotnet tool install --global dotnet-sonarscanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin /k:"GeneGenie.Gedcom" /o:"thegenegenieproject" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
dotnet build --no-incremental
dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
dotnet sonarscanner end
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,6 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

# JtBrains Rider
**/.idea/**
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Major changes should have benchmarks wrapped around the old and new code to prov

### Style guidelines

The StyleCop.Analyzer nuget package is used in all projects to help enforce style guidelines. These guidelines are there to ensure a consistent style, I don't necessarily agree with all of them but they represent a good compromise. When we remove the final few build warnings from the compiler, style violations will be treated as errors and will halt any build.
The .editorconfig settings file is used in all projects to help enforce style guidelines. These guidelines are there to ensure a consistent style, I don't necessarily agree with all of them but they represent a good compromise. When we remove the final few build warnings from the compiler, style violations will be treated as errors and will halt any build.
7 changes: 7 additions & 0 deletions GeneGenie.Gedcom.Sample/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Allow inheritence of settings from directory above.
root = false

[*.{cs,vb}]
dotnet_diagnostic.CA1303.severity = none
dotnet_diagnostic.CA1812.severity = none
dotnet_diagnostic.CA1848.severity = none
18 changes: 3 additions & 15 deletions GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -13,22 +13,10 @@
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
-->
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="..\stylecop.json" Link="stylecop.json" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\GlobalSuppressions.cs" Link="GlobalSuppressions.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
62 changes: 0 additions & 62 deletions GeneGenie.Gedcom.Sample/GeneGenie.Gedcom.Sample.xml

This file was deleted.

1 change: 0 additions & 1 deletion GeneGenie.Gedcom.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (c) GeneGenie.com. All Rights Reserved.
// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information.
// </copyright>
// <author> Copyright (C) 2016 Ryan O'Neill r@genegenie.com </author>

namespace GeneGenie.Gedcom.Sample
{
Expand Down
2 changes: 1 addition & 1 deletion GeneGenie.Gedcom.Sample/Step1LoadTreeFromFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static GedcomDatabase LoadPresidentsTree()

private static GedcomDatabase LoadGedcomFromFile()
{
var gedcomReader = GedcomRecordReader.CreateReader("Data\\presidents.ged");
var gedcomReader = GedcomRecordReader.CreateReader("Data/presidents.ged");
if (gedcomReader.Parser.ErrorState != Enums.GedcomErrorState.NoError)
{
Console.WriteLine($"Could not read file, encountered error {gedcomReader.Parser.ErrorState} press a key to continue.");
Expand Down
1 change: 0 additions & 1 deletion GeneGenie.Gedcom.Sample/Step2QueryTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright (c) GeneGenie.com. All Rights Reserved.
// Licensed under the GNU Affero General Public License v3.0. See LICENSE in the project root for license information.
// </copyright>
// <author> Copyright (C) 2016 Ryan O'Neill r@genegenie.com </author>

namespace GeneGenie.Gedcom.Sample
{
Expand Down
Loading

0 comments on commit 787ab8c

Please sign in to comment.