Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Feb 8, 2023
2 parents 0b0e8ba + 992e047 commit ddf1679
Show file tree
Hide file tree
Showing 148 changed files with 5,214 additions and 9,672 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ jobs:
- name: Install dotnet format
run: dotnet tool update -g dotnet-format
- name: Check Format
run: dotnet format --verify-no-changes --severity error src/
run: dotnet format --verify-no-changes --severity warn src/

36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [1.6.6](https://github.com/Terradue/DotNetStac/compare/1.6.5...1.6.6)
## [1.7.0](https://github.com/Terradue/DotNetStac/compare/1.6.6...1.7.0)

Style and format improvements

### Merged

- Style and format improvements [`#23`](https://github.com/Terradue/DotNetStac/pull/23)

### Commits

- removed item-collection extension [`f99d497`](https://github.com/Terradue/DotNetStac/commit/f99d4970501650ddb04811e13a81e9445b3f2e01)
- many format fix with dotnet format [`f7a3898`](https://github.com/Terradue/DotNetStac/commit/f7a3898967bb3f8d8eb37aed46866f71a258bd27)
- and more linting [`b201bcf`](https://github.com/Terradue/DotNetStac/commit/b201bcff3f655766b7903d4d4e603a5e95496566)
- Prefix local calls with this [`ac186ea`](https://github.com/Terradue/DotNetStac/commit/ac186ea9d87b39724aff5b627e499b4553e60e12)
- Elements must appear in the correct order [`6505476`](https://github.com/Terradue/DotNetStac/commit/6505476b85d2bfba412f00bff32edb20d4883716)
- fields [`5d6219d`](https://github.com/Terradue/DotNetStac/commit/5d6219d6ad37562f0c97295cc1d130deb3d4671f)
- more styling [`d47db36`](https://github.com/Terradue/DotNetStac/commit/d47db36bf8c0ee60a361497d5e661a93a049ce61)
- more style [`596b5e1`](https://github.com/Terradue/DotNetStac/commit/596b5e11ea5c37cdcf7e083d7a568bde596b9a5b)
- SA1513 [`b7ac0bd`](https://github.com/Terradue/DotNetStac/commit/b7ac0bd271bf95e0fca8a91ffac63956944a7ee7)
- Element documentation header must be preceded by blank line [`0a08850`](https://github.com/Terradue/DotNetStac/commit/0a0885044f5e320a1e5fae0096ecf7b21cfd8d13)
- styling [`e95db31`](https://github.com/Terradue/DotNetStac/commit/e95db311f5ceb41c6542e257b7aa62859deead5f)
- no warinings [`da591b0`](https://github.com/Terradue/DotNetStac/commit/da591b098397fe44d098153a5fcbd1c1301f2595)
- Do not use placeholders in summaries [`466baaf`](https://github.com/Terradue/DotNetStac/commit/466baaf763bb32c377dc4b0742699d9cb180184e)
- remove blank lines [`7ccb21a`](https://github.com/Terradue/DotNetStac/commit/7ccb21ab1d379d242e8f04567ddc45bb56019483)
- removed empty values [`d6d6cba`](https://github.com/Terradue/DotNetStac/commit/d6d6cba7e081978030f248b4f7ea1851653a9cbc)
- more linting [`6b6d074`](https://github.com/Terradue/DotNetStac/commit/6b6d0749103bde3e4be4e817f52c2f15c5810d9c)
- SA1115 [`4ab4544`](https://github.com/Terradue/DotNetStac/commit/4ab454479fc8bbf9f4263b6d94e64af39a143d1c)
- removed empty return [`a0cb741`](https://github.com/Terradue/DotNetStac/commit/a0cb74141c0f0d864b0b85be91c5b562f9c833aa)
- Do not use regions [`ebce9c3`](https://github.com/Terradue/DotNetStac/commit/ebce9c3f241dead6710be6a19bd50d8bb7d7e69b)
- Statement must not use unnecessary parenthesis [`87c4fb6`](https://github.com/Terradue/DotNetStac/commit/87c4fb6bb835838511331866aa83424bcfb52ada)
- remove static [`b0b16e0`](https://github.com/Terradue/DotNetStac/commit/b0b16e075b96e0d5b3e5d6b3f1f4f5c3f018a882)
- linting [`664ce61`](https://github.com/Terradue/DotNetStac/commit/664ce612c8c35e79e95d3f058cb9566d17497eb5)
- severity warning for code liniting [`6f2ddfd`](https://github.com/Terradue/DotNetStac/commit/6f2ddfd5ae1995eada15d8a2cf111946a0dc015e)

## [1.6.6](https://github.com/Terradue/DotNetStac/compare/1.6.5...1.6.6) - 2023-02-03

### Commits

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<h3 align="center">

![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=hotfix/1.6.6)
![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=release/1.7.0)
[![NuGet](https://img.shields.io/nuget/vpre/DotNetStac)](https://www.nuget.org/packages/DotNetStac/)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/hotfix/1.6.6/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/release/1.7.0/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![Gitter](https://img.shields.io/gitter/room/SpatioTemporal-Asset-Catalog/Lobby?color=yellow)](https://gitter.im/SpatioTemporal-Asset-Catalog/Lobby)
[![License](https://img.shields.io/badge/license-AGPL3-blue.svg)](LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Terradue/DotNetStac/master?filepath=example.ipynb)
Expand Down
18 changes: 18 additions & 0 deletions omnisharp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"RoslynExtensionsOptions": {
"enableAnalyzersSupport": true
},
"FormattingOptions": {
"enableEditorConfigSupport": true,
"OrganizeImports": true
},
"RenameOptions": {
"RenameInComments": true,
"RenameOverloads": true,
"RenameInStrings": true
},
"ImplementTypeOptions": {
"PropertyGenerationBehavior": "PreferAutoProperties",
"InsertionBehavior": "WithOtherMembersOfTheSameKind"
}
}
57 changes: 53 additions & 4 deletions src/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dotnet_naming_rule.constants_must_be_pascal_cased.style
dotnet_naming_rule.constants_must_be_pascal_cased.severity = warning

dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.symbols = private_static_field_symbols
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.style = camel_case_and_prefix_with_s_underscore_style
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.style = pascal_case_style
dotnet_naming_rule.private_static_fields_must_be_camel_cased_and_prefixed_with_s_underscore.severity = warning

dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = private_field_symbols
Expand Down Expand Up @@ -370,6 +370,7 @@ dotnet_diagnostic.RS0018.severity = warning
dotnet_diagnostic.RS0010.severity = warning

# Microsoft.CodeAnalysis.CSharp.Features
# Prefix local calls with this
# Name: Before: After:
dotnet_diagnostic.IDE0001.severity = warning # Simplify names System.Version version; Version version;
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) System.Version.Equals("1", "2"); Version.Equals("1", "2");
Expand All @@ -396,6 +397,54 @@ dotnet_diagnostic.VSTHRD111.severity = none # Use ConfigureAwait(true).
dotnet_diagnostic.VSSDK006.severity = none # Check whether the result of GetService calls is null

# Microsoft.CodeAnalysis.VisualBasic.CodeStyle/Microsoft.CodeAnalysis.CSharp.CodeStyle
dotnet_diagnostic.IDE0073.severity = warning # Enforce file header
file_header_template = Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

dotnet_diagnostic.IDE0073.severity = warning # Enforce file header

file_header_template = Copyright (c) by Terradue Srl. All Rights Reserved.\nLicense under the AGPL, Version 3.0.\nFile Name: {fileName}

# Microsoft.CodeAnalysis.CSharp.CodeStyle
dotnet_diagnostic.SA1005.severity = warning # Single line comments should begin with single space
dotnet_diagnostic.SA1028.severity = warning # Code should not contain trailing whitespace
dotnet_diagnostic.SA1101.severity = warning # Prefix local calls with this
dotnet_diagnostic.SA1107.severity = warning # Code should not contain multiple statements on one line
dotnet_diagnostic.SA1111.severity = warning # Closing parenthesis should be on line of last parameter
dotnet_diagnostic.SA1115.severity = warning # Parameter should follow comma
dotnet_diagnostic.SA1116.severity = warning # Split parameters should start on line after declaration
dotnet_diagnostic.SA1119.severity = warning # Statement must not use unnecessary parenthesis
dotnet_diagnostic.SA1122.severity = warning # Use string.Empty for empty strings
dotnet_diagnostic.SA1124.severity = warning # Do not use regions
dotnet_diagnostic.SA1127.severity = warning # Generic type constraints must be on their own line or share line with previous
dotnet_diagnostic.SA1128.severity = warning # Put constructor initializers on their own line
dotnet_diagnostic.SA1129.severity = warning # Do not use default value type constructor
dotnet_diagnostic.SA1132.severity = warning # Do not combine fields
dotnet_diagnostic.SA1137.severity = warning # Elements should have the same indentation
dotnet_diagnostic.SA1201.severity = warning # Elements must appear in the correct order
dotnet_diagnostic.SA1202.severity = warning # Elements must be ordered by access
dotnet_diagnostic.SA1204.severity = warning # Static elements must appear before instance elements
dotnet_diagnostic.SA1214.severity = warning # Readonly fields must appear before non-readonly fields
dotnet_diagnostic.SA1306.severity = none # Field names must begin with lower-case letter
dotnet_diagnostic.SA1311.severity = warning # Static readonly fields must begin with upper-case letter
dotnet_diagnostic.SA1407.severity = warning # Arithmetic expressions must declare precedence
dotnet_diagnostic.SA1412.severity = warning # Store files as UTF-8 with byte order mark
dotnet_diagnostic.SA1413.severity = warning # Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1500.severity = warning # Braces for multi-line statements must not share line
dotnet_diagnostic.SA1501.severity = warning # Braces must not be omitted
dotnet_diagnostic.SA1503.severity = warning # Braces must not be omitted
dotnet_diagnostic.SA1504.severity = warning # All accessors must be single-line or multi-line
dotnet_diagnostic.SA1505.severity = warning # An opening brace must not be followed by a blank line
dotnet_diagnostic.SA1506.severity = warning # Element documentation header must not be preceded by blank line
dotnet_diagnostic.SA1507.severity = warning # Code should not contain multiple blank lines in a row
dotnet_diagnostic.SA1508.severity = warning # A closing brace must not be preceded by a blank line
dotnet_diagnostic.SA1513.severity = warning # Closing brace must be followed by blank line
dotnet_diagnostic.SA1514.severity = warning # Element documentation header must be preceded by blank line
dotnet_diagnostic.SA1515.severity = warning # Single-line comment must be preceded by blank line
dotnet_diagnostic.SA1516.severity = warning # Elements must be separated by blank line
dotnet_diagnostic.SA1518.severity = warning # Code should end with a newline
dotnet_diagnostic.SA1519.severity = warning # Braces should not be omitted from multi-line child statement
dotnet_diagnostic.SA1520.severity = warning # Use braces consistently
dotnet_diagnostic.SA1623.severity = warning # Property summary documentation must match accessors
dotnet_diagnostic.SA1626.severity = warning # Single-line comments must not use documentation style slashes
dotnet_diagnostic.SA1636.severity = none # Disable file header matching
dotnet_diagnostic.SA1642.severity = warning # Constructor summary documentation must begin with standard text
dotnet_diagnostic.SA1649.severity = warning # File name must match first type name
dotnet_diagnostic.SA1651.severity = warning # Do not use placeholders in summaries
dotnet_diagnostic.SX1309.severity = warning # Field names should begin with underscore
6 changes: 5 additions & 1 deletion src/DotNetStac.Test/Catalog/CatalogTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: CatalogTests.cs

using System;
using Newtonsoft.Json;
using Xunit;

Expand Down
9 changes: 5 additions & 4 deletions src/DotNetStac.Test/Catalog/StacRepositoryCatalogTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: StacRepositoryCatalogTests.cs

using Xunit;

namespace Stac.Test.Catalog
Expand All @@ -10,7 +11,7 @@ public class StacRepositoryCatalogTests : TestBase
[Fact]
public void CanDeserializeBaseCatalogExample()
{
var json = httpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/catalog.json").GetAwaiter().GetResult();
var json = HttpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/catalog.json").GetAwaiter().GetResult();

StacCatalog catalog = StacConvert.Deserialize<StacCatalog>(json);

Expand Down
15 changes: 8 additions & 7 deletions src/DotNetStac.Test/Collection/CollectionTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: CollectionTests.cs

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using System.Text;
using GeoJSON.Net;
using GeoJSON.Net.Geometry;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Stac.Collection;
Expand Down Expand Up @@ -45,10 +46,10 @@ public void CanDeserializeSentinel2Sample()

Assert.IsType<StacSummaryRangeObject<DateTime>>(item.Summaries["datetime"]);

Assert.Equal<DateTime>(DateTime.Parse("2015-06-23T00:00:00Z").ToUniversalTime(), (item.Summaries["datetime"] as StacSummaryRangeObject<DateTime>).Min);
Assert.Equal(DateTime.Parse("2015-06-23T00:00:00Z").ToUniversalTime(), (item.Summaries["datetime"] as StacSummaryRangeObject<DateTime>).Min);

Assert.Equal<long>(32601, (item.Summaries["proj:epsg"] as StacSummaryValueSet<long>).Min());
Assert.Equal<long>(32660, (item.Summaries["proj:epsg"] as StacSummaryValueSet<long>).Max());
Assert.Equal(32601, (item.Summaries["proj:epsg"] as StacSummaryValueSet<long>).Min());
Assert.Equal(32660, (item.Summaries["proj:epsg"] as StacSummaryValueSet<long>).Max());
Assert.Equal<long>(60, (item.Summaries["proj:epsg"] as StacSummaryValueSet<long>).Count);

Assert.Equal(13, item.Summaries["eo:bands"].LongCount());
Expand Down
19 changes: 10 additions & 9 deletions src/DotNetStac.Test/Collection/StacRepositoryCollectionTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: StacRepositoryCollectionTests.cs

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;

namespace Stac.Test.Catalog
Expand All @@ -14,7 +15,7 @@ public class StacRepositoryCollectionTests : TestBase
[Fact]
public void CanDeserializeBaseCollectionExample()
{
var json = httpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/collection.json").GetAwaiter().GetResult();
var json = HttpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/collection.json").GetAwaiter().GetResult();

ValidateJson(json);

Expand All @@ -34,22 +35,22 @@ public void CanDeserializeBaseCollectionExample()
[Fact]
public void CanCreateBaseCollectionExample()
{
var expectedJson = httpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/collection.json").GetAwaiter().GetResult();
var expectedJson = HttpClient.GetStringAsync($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/collection.json").GetAwaiter().GetResult();
//TMP
expectedJson = expectedJson.Replace("\"proj:epsg\": {\n \"minimum\": 32659,\n \"maximum\": 32659\n }", "\"proj:epsg\":[32659]");

ValidateJson(expectedJson);

Dictionary<Uri, StacItem> items = new Dictionary<Uri, StacItem>();
Uri simpleItemUri = new Uri($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/simple-item.json");
items.Add(simpleItemUri, StacConvert.Deserialize<StacItem>(httpClient.GetStringAsync(simpleItemUri).GetAwaiter().GetResult()));
items.Add(simpleItemUri, StacConvert.Deserialize<StacItem>(HttpClient.GetStringAsync(simpleItemUri).GetAwaiter().GetResult()));
items[simpleItemUri].Title = "Simple Item";
Uri coreItemUri = new Uri($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/core-item.json");
string coreItemJson = httpClient.GetStringAsync(coreItemUri).GetAwaiter().GetResult();
string coreItemJson = HttpClient.GetStringAsync(coreItemUri).GetAwaiter().GetResult();
coreItemJson = coreItemJson.Replace("cool_sat2", "cool_sat1");
items.Add(coreItemUri, StacConvert.Deserialize<StacItem>(coreItemJson));
Uri extendedItemUri = new Uri($"https://raw.githubusercontent.com/radiantearth/stac-spec/v{Versions.StacVersionList.Current}/examples/extended-item.json");
string extendedItemJson = httpClient.GetStringAsync(extendedItemUri).GetAwaiter().GetResult();
string extendedItemJson = HttpClient.GetStringAsync(extendedItemUri).GetAwaiter().GetResult();
extendedItemJson = extendedItemJson.Replace("cool_sensor_v1", "cool_sensor_v2");
items.Add(extendedItemUri, StacConvert.Deserialize<StacItem>(extendedItemJson));
StacCollection collection = StacCollection.Create("simple-collection",
Expand Down
11 changes: 6 additions & 5 deletions src/DotNetStac.Test/Common/PatchHelpersTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using GeoJSON.Net.Geometry;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: PatchHelpersTests.cs

using Newtonsoft.Json;
using Stac.Collection;
using Stac.Common;
using Xunit;

Expand All @@ -16,7 +17,7 @@ public void PatchStacItemTest()

StacItem patchItem = StacConvert.Deserialize<StacItem>(GetJson("Common", "Patch"));

StacItem patchedItem = baseItem.Patch<StacItem>(patchItem);
StacItem patchedItem = baseItem.Patch(patchItem);

JsonAssert.AreEqual(GetJson("Common", "PatchedItem"), StacConvert.Serialize(patchedItem));
}
Expand All @@ -28,7 +29,7 @@ public void PatchStacItemTest2()

Patch patchItem = JsonConvert.DeserializeObject<Patch>(GetJson("Common", "Patch2"));

StacItem patchedItem = baseItem.Patch<StacItem>(patchItem);
StacItem patchedItem = baseItem.Patch(patchItem);

JsonAssert.AreEqual(GetJson("Common", "PatchedItem2"), StacConvert.Serialize(patchedItem));
}
Expand Down
8 changes: 6 additions & 2 deletions src/DotNetStac.Test/Common/StacAccessorsHelpersTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System.Collections.Generic;
// Copyright (c) by Terradue Srl. All Rights Reserved.
// License under the AGPL, Version 3.0.
// File Name: StacAccessorsHelpersTests.cs

using System.Collections.Generic;
using GeoJSON.Net.Geometry;
using Stac.Collection;
using Stac.Common;
Expand Down Expand Up @@ -54,7 +58,7 @@ public void GetPropertyTest()

item.SetProperty("summary", summaryItemType);

Assert.NotNull(item.GetProperty<SummaryItemType>("summary"));
Assert.NotNull(item.GetProperty<SummaryItemType?>("summary"));

summaryItemType = SummaryItemType.RangeObject;

Expand Down
Loading

0 comments on commit ddf1679

Please sign in to comment.