Skip to content

Commit

Permalink
build: Enable nullable reference types
Browse files Browse the repository at this point in the history
Enable nullable reference types by default but disable for demo and test data projects.
Disable nullable for all code files where errors were found
  • Loading branch information
ap0llo committed Dec 29, 2019
1 parent 852c242 commit 9514504
Show file tree
Hide file tree
Showing 87 changed files with 250 additions and 82 deletions.
3 changes: 2 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>

<PropertyGroup>
<LangVersion>7.3</LangVersion>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<IsPackable>false</IsPackable>
<AssemblyVersion>1.2.3</AssemblyVersion>
<Version>1.2.3</Version>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model.Test/TestBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Linq;
using System.Reflection;
using Grynwald.MdDocs.ApiReference.Model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.IO;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Reflection;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model;
using Xunit.Abstractions;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/EventDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
using Mono.Cecil;

Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/FieldDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
using Mono.Cecil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/ModuleDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/ParameterDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
using Grynwald.Utilities.Collections;
using Mono.Cecil;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/PropertyDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
using Grynwald.Utilities.Collections;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/TypeDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/TypeParameterDocumentation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;
using Grynwald.Utilities.Collections;
using Mono.Cecil;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/XmlDocs/NullXmlDocsProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
#nullable disable

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
/// <summary>
/// Empty implementation of <see cref="IXmlDocsProvider"/>.
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/XmlDocs/SeeAlsoElement.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/XmlDocs/XmlDocsReader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// The code in this file is derived from the "DocReader" class from the NuDoq project.
#nullable disable

// The code in this file is derived from the "DocReader" class from the NuDoq project.
// The original version of this file was downloaded from
// https://github.com/kzu/NuDoq/blob/56ad8c508003490d859214753591440b123616f5/src/NuDoq/DocReader.cs
//
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/XmlDocs/_Ids/MemberIdParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/XmlDocs/_Ids/TypeIdBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model.XmlDocs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Linq;
#nullable disable

using System.Linq;
using Mono.Cecil;

namespace Grynwald.MdDocs.ApiReference.Model
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Linq;
using Mono.Cecil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Xml.Linq;
#nullable disable

using System.Xml.Linq;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/ArrayTypeId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/ByReferenceTypeId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/EventId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/FieldId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/GenericTypeId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/GenericTypeInstanceId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/GenericTypeParameterId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#nullable disable

using System;

namespace Grynwald.MdDocs.ApiReference.Model
{
Expand Down
4 changes: 3 additions & 1 deletion src/MdDocs.ApiReference.Model/_Ids/MemberId.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Collections.Generic;
#nullable disable

using System.Collections.Generic;
using Grynwald.MdDocs.ApiReference.Model.XmlDocs;

namespace Grynwald.MdDocs.ApiReference.Model
Expand Down
Loading

0 comments on commit 9514504

Please sign in to comment.