Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ dotnet_diagnostic.SA1121.severity = none
# SA1124: Do not use regions
dotnet_diagnostic.SA1124.severity = suggestion

# SA1201: Elements must appear in the correct order
dotnet_diagnostic.SA1201.severity = suggestion

# SA1202: Elements should be ordered by access
dotnet_diagnostic.SA1202.severity = none

Expand Down Expand Up @@ -277,13 +280,18 @@ dotnet_diagnostic.SA1513.severity = none
# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none

# SA1633: The file header is missing or not located at the top of the file
dotnet_diagnostic.SA1633.severity = none

# S1104: Fields should not have public accessibility
dotnet_diagnostic.S1104.severity = none

# S2344: Enumeration type names should not have "Flags" or "Enum" suffixes
dotnet_diagnostic.S2344.severity = none
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_prefer_static_anonymous_function = true:suggestion
csharp_prefer_system_threading_lock = true:suggestion
csharp_style_prefer_simple_property_accessors = true:suggestion

[*.{config,crproj,csproj,props,pubxml,runsettings,settings,svcinfo,targets,vcxproj,wixproj,wxi,wxl,wxs,xml}]

Expand Down Expand Up @@ -342,24 +350,3 @@ dotnet_diagnostic.CA1513.severity = none
dotnet_diagnostic.CA1510.severity = none
dotnet_diagnostic.CA1847.severity = none
dotnet_diagnostic.CA1512.severity = none

[*.{hlsl}]

# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
trim_trailing_whitespace = true

# Specific files
[{ort_inference.cc,ort_inference.h,pixel_classifier.h}]

indent_size = 4
indent_style = space
tab_width = 4
trim_trailing_whitespace = true
cpp_indent_namespace_contents = false
cpp_indent_multi_line_relative_to = innermost_parenthesis
cpp_indent_within_parentheses = align_to_parenthesis
cpp_indent_preserve_within_parentheses = true
tab_width = 4
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
<PackageVersion Include="MSTest" Version="4.0.2" />
<PackageVersion Include="StyleCop.Analyzers.Unstable" Version="1.2.0.556" />
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="8.0.0" />
Expand Down
9 changes: 9 additions & 0 deletions Directory.csproj.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@
<!-- Workaround for https://github.com/dotnet/roslyn/issues/41640 -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- StyleCop -->
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Visible="false" />
<PackageReference Include="StyleCop.Analyzers.Unstable">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions OpenMcdf.Ole.Tests/OlePropertiesExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

namespace OpenMcdf.Ole.Tests;

/// <summary>
/// Summary description for UnitTest1.
/// </summary>
[TestClass]
public class OlePropertiesExtensionsTests
{
Expand Down
13 changes: 13 additions & 0 deletions OpenMcdf.Ole/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# C# files
[*.cs]

dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none

# SA1108: Block statements should not contain embedded comments
dotnet_diagnostic.SA1108.severity = none

# SA1204: Static members should appear before non-static members
dotnet_diagnostic.SA1204.severity = none

# SA1515: Single-line comment should be preceded by blank line
dotnet_diagnostic.SA1515.severity = none
2 changes: 2 additions & 0 deletions OpenMcdf.Ole/TypedPropertyValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
internal abstract class TypedPropertyValue<T> : ITypedPropertyValue
{
private readonly VTPropertyType vtType;

[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:Fields should be private", Justification = "TODO")]
protected object? propertyValue;

public PropertyType PropertyType => PropertyType.TypedPropertyValue;
Expand Down
2 changes: 2 additions & 0 deletions OpenMcdf.Tests/TestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ public static class TestData
/// <summary>
/// Fill with bytes equal to their position modulo 256.
/// </summary>
/// <param name="length">The number of bytes to include in the array.</param>
/// <returns>A byte array where each element is set to its index value modulo 256.</returns>
public static byte[] CreateByteArray(int length)
{
byte[] expectedBuffer = new byte[length];
Expand Down
1 change: 1 addition & 0 deletions OpenMcdf.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<File Path="global.json" />
<File Path="License.txt" />
<File Path="README.md" />
<File Path="stylecop.json" />
</Folder>
<Project Path="OpenMcdf.Benchmarks/OpenMcdf.Benchmarks.csproj" />
<Project Path="OpenMcdf.Ole.Tests/OpenMcdf.Ole.Tests.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion OpenMcdf/DirectoryTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void Remove(DirectoryEntry entry)
{
uint newRightChildParentId = entry.LeftSiblingId;
DirectoryEntry newRightChildParent;
for (; ; )
while (true)
{
newRightChildParent = directories.GetDictionaryEntry(newRightChildParentId);
newRightChildParentId = newRightChildParent.RightSiblingId;
Expand Down
10 changes: 10 additions & 0 deletions OpenMcdf/EntryInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
namespace OpenMcdf;

/// <summary>
/// Specifies the type of entry for a <see cref="EntryInfo"/>.
/// </summary>
public enum EntryType
{
/// <summary>
/// A storage entry, which may contain other entries.
/// </summary>
Storage,

/// <summary>
/// A stream entry containing binary data.
/// </summary>
Stream,
}

Expand Down
2 changes: 1 addition & 1 deletion OpenMcdf/FatChainEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public bool MoveNext()
/// <summary>
/// Moves to the specified index within the FAT sector chain.
/// </summary>
/// <param name="index"></param>
/// <param name="index">The index to move to.</param>
/// <returns>true if the enumerator was successfully advanced to the given index.</returns>
public bool MoveTo(uint index)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenMcdf/MiniFatChainEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public bool MoveNext()
/// <summary>
/// Moves to the specified index within the mini FAT sector chain.
/// </summary>
/// <param name="index"></param>
/// <param name="index">The index to move to.</param>
/// <returns>true if the enumerator was successfully advanced to the given index.</returns>
public bool MoveTo(uint index)
{
Expand Down
3 changes: 3 additions & 0 deletions OpenMcdf/RootStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace OpenMcdf;
/// </summary>
public enum Version : ushort
{
/// <summary>
/// Unknown version.
/// </summary>
Unknown = 0,

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions StructuredStorage/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# C# files
[*.cs]

dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none
7 changes: 7 additions & 0 deletions StructuredStorageExplorer/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# C# files
[*.cs]

dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = none

# SA1204: Static members should appear before non-static members
dotnet_diagnostic.SA1204.severity = none
18 changes: 18 additions & 0 deletions stylecop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"companyName": "OpenMcdf",
"copyrightText": "Copyright © 2010-2025, Federico Blaseotto, Jeremy Powell",
"documentInterfaces": false,
"documentExposedElements": true,
"documentInternalElements": false,
"documentPrivateElements": false,
"documentPrivateFields": false,
"xmlHeader": false
},
"layoutRules": {
"allowDoWhileOnClosingBrace": true
}
}
}
Loading