Skip to content

Commit c090698

Browse files
authored
Merge pull request #8 from Atypical-Consulting/features-linting
Add .editorconfig and lint the code
2 parents e9364bb + 60998ec commit c090698

27 files changed

Lines changed: 2930 additions & 2966 deletions

.editorconfig

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggest
110110
#Style - Modifier preferences
111111

112112
#when this rule is set to a list of modifiers, prefer the specified ordering.
113-
csharp_preferred_modifier_order = public,protected,private,internal,static,async,abstract,virtual,readonly,sealed,override:suggestion
113+
csharp_preferred_modifier_order = public, protected, private, internal, static, async, abstract, virtual, readonly, sealed, override:suggestion
114114

115115
#Style - Pattern matching
116116

@@ -167,31 +167,31 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
167167

168168
dotnet_naming_symbols.interface.applicable_kinds = interface
169169
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
170-
dotnet_naming_symbols.interface.required_modifiers =
170+
dotnet_naming_symbols.interface.required_modifiers =
171171

172172
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
173173
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
174-
dotnet_naming_symbols.types.required_modifiers =
174+
dotnet_naming_symbols.types.required_modifiers =
175175

176176
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
177177
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
178-
dotnet_naming_symbols.non_field_members.required_modifiers =
178+
dotnet_naming_symbols.non_field_members.required_modifiers =
179179

180180
# Naming styles
181181

182182
dotnet_naming_style.begins_with_i.required_prefix = I
183-
dotnet_naming_style.begins_with_i.required_suffix =
184-
dotnet_naming_style.begins_with_i.word_separator =
183+
dotnet_naming_style.begins_with_i.required_suffix =
184+
dotnet_naming_style.begins_with_i.word_separator =
185185
dotnet_naming_style.begins_with_i.capitalization = pascal_case
186186

187-
dotnet_naming_style.pascal_case.required_prefix =
188-
dotnet_naming_style.pascal_case.required_suffix =
189-
dotnet_naming_style.pascal_case.word_separator =
187+
dotnet_naming_style.pascal_case.required_prefix =
188+
dotnet_naming_style.pascal_case.required_suffix =
189+
dotnet_naming_style.pascal_case.word_separator =
190190
dotnet_naming_style.pascal_case.capitalization = pascal_case
191191

192-
dotnet_naming_style.pascal_case.required_prefix =
193-
dotnet_naming_style.pascal_case.required_suffix =
194-
dotnet_naming_style.pascal_case.word_separator =
192+
dotnet_naming_style.pascal_case.required_prefix =
193+
dotnet_naming_style.pascal_case.required_suffix =
194+
dotnet_naming_style.pascal_case.word_separator =
195195
dotnet_naming_style.pascal_case.capitalization = pascal_case
196196
dotnet_style_operator_placement_when_wrapping = beginning_of_line
197197
tab_width = 4

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
A virtual file system implementation in modern C#.
44

5-
When writing applications in .NET, you often need to write or read the contents of a file. .NET provides `System.IO` namespace dedicated to this purpose. But how do we deal with the filesystem when testing our code?
6-
7-
"Virtual File System" is an attempt to solve this problem. Currently, this library is at an early stage of development. If you need additional functionality, I invite you to open an issue to discuss it.
5+
When writing applications in .NET, you often need to write or read the contents of a file. .NET provides `System.IO`
6+
namespace dedicated to this purpose. But how do we deal with the filesystem when testing our code?
87

8+
"Virtual File System" is an attempt to solve this problem. Currently, this library is at an early stage of development.
9+
If you need additional functionality, I invite you to open an issue to discuss it.
910

1011
## Badges
1112

@@ -16,7 +17,6 @@ _Social buttons_
1617
[![stars - VirtualFileSystem](https://img.shields.io/github/stars/Atypical-Consulting/VirtualFileSystem?style=social)](https://github.com/Atypical-Consulting/VirtualFileSystem)
1718
[![forks - VirtualFileSystem](https://img.shields.io/github/forks/Atypical-Consulting/VirtualFileSystem?style=social)](https://github.com/Atypical-Consulting/VirtualFileSystem)
1819

19-
2020
_Repo metadata_
2121

2222
[![GitHub tag](https://img.shields.io/github/tag/Atypical-Consulting/VirtualFileSystem?include_prereleases=&sort=semver&color=blue)](https://github.com/Atypical-Consulting/VirtualFileSystem/releases/)
@@ -30,21 +30,24 @@ _Call-to-Action buttons_
3030
[![View site - GH Pages](https://img.shields.io/badge/View_site-GH_Pages-2ea44f?style=for-the-badge)](https://atypical-consulting.github.io/VirtualFileSystem/)
3131
[![view - Documentation](https://img.shields.io/badge/view-Documentation-blue?style=for-the-badge)](/docs/ "Go to project documentation")
3232

33-
3433
## What is a virtual file system and why should I use it?
35-
A virtual file system is a data structure that represents a file system in memory. It is used to simulate a file system on a computer. It is useful for testing purposes, for example, when you want to test a file system without actually creating files on the hard drive.
3634

35+
A virtual file system is a data structure that represents a file system in memory. It is used to simulate a file system
36+
on a computer. It is useful for testing purposes, for example, when you want to test a file system without actually
37+
creating files on the hard drive.
3738

3839
## We use the lastest C# features
3940

40-
This library targets .NET 7.0 and uses the latest C# features. It is written in C# 11.0 and uses the new `init` properties, `record` types, `switch` expressions, `using` declarations, and more.
41-
42-
I invite you to read the [C# 11.0 documentation](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11) to learn more about these features.
41+
This library targets .NET 7.0 and uses the latest C# features. It is written in C# 11.0 and uses the new `init`
42+
properties, `record` types, `switch` expressions, `using` declarations, and more.
4343

44+
I invite you to read the [C# 11.0 documentation](https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11) to
45+
learn more about these features.
4446

4547
## License
4648

4749
This project is licensed under the terms of the BSD-3-Clause license.
4850
If you use this library in your project, please consider adding a link to this repository in your project's README.
4951

50-
This project is maintained by [Atypical Consulting](https://www.atypical.consulting/). If you need help with this project, please contact us from this repository by opening an issue.
52+
This project is maintained by [Atypical Consulting](https://www.atypical.consulting/). If you need help with this
53+
project, please contact us from this repository by opening an issue.
Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
// Copyright (c) 2022, Atypical Consulting SRL
2-
// All rights reserved.
3-
//
4-
// This source code is licensed under the BSD-style license found in the
5-
// LICENSE file in the root directory of this source tree.
6-
7-
namespace Atypical.VirtualFileSystem.Core.Abstractions;
8-
9-
/// <summary>
10-
/// Represents a node in a virtual file system.
11-
/// A node can be a file or a directory.
12-
/// </summary>
13-
public abstract record VFSNode
14-
: IVirtualFileSystemNode
15-
{
16-
/// <summary>
17-
/// Initializes a new instance of the <see cref="VFSNode"/> class.
18-
/// This constructor is used by derived classes.
19-
/// </summary>
20-
/// <param name="path">The path of the node.</param>
21-
protected VFSNode(VFSPath path)
22-
{
23-
ArgumentNullException.ThrowIfNull(path);
24-
25-
// set timestamps
26-
var now = DateTime.UtcNow;
27-
CreationTime = now;
28-
LastAccessTime = now;
29-
LastWriteTime = now;
30-
}
31-
32-
/// <inheritdoc cref="IVirtualFileSystemNode.CreationTime"/>
33-
public abstract VFSPath Path { get; }
34-
35-
/// <inheritdoc cref="IVirtualFileSystemNode.CreationTime"/>
36-
public DateTimeOffset CreationTime { get; }
37-
38-
/// <inheritdoc cref="IVirtualFileSystemNode.LastAccessTime"/>
39-
public DateTimeOffset LastAccessTime { get; }
40-
41-
/// <inheritdoc cref="IVirtualFileSystemNode.LastWriteTime"/>
42-
public DateTimeOffset LastWriteTime { get; }
43-
44-
/// <inheritdoc cref="IVirtualFileSystemNode.IsDirectory"/>
45-
public abstract bool IsDirectory { get; }
46-
47-
/// <inheritdoc cref="IVirtualFileSystemNode.IsFile"/>
48-
public abstract bool IsFile { get; }
1+
// Copyright (c) 2022, Atypical Consulting SRL
2+
// All rights reserved.
3+
//
4+
// This source code is licensed under the BSD-style license found in the
5+
// LICENSE file in the root directory of this source tree.
6+
7+
namespace Atypical.VirtualFileSystem.Core.Abstractions;
8+
9+
/// <summary>
10+
/// Represents a node in a virtual file system.
11+
/// A node can be a file or a directory.
12+
/// </summary>
13+
public abstract record VFSNode
14+
: IVirtualFileSystemNode
15+
{
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="VFSNode" /> class.
18+
/// This constructor is used by derived classes.
19+
/// </summary>
20+
/// <param name="path">The path of the node.</param>
21+
protected VFSNode(VFSPath path)
22+
{
23+
ArgumentNullException.ThrowIfNull(path);
24+
25+
// set timestamps
26+
var now = DateTime.UtcNow;
27+
CreationTime = now;
28+
LastAccessTime = now;
29+
LastWriteTime = now;
30+
}
31+
32+
/// <inheritdoc cref="IVirtualFileSystemNode.CreationTime" />
33+
public abstract VFSPath Path { get; }
34+
35+
/// <inheritdoc cref="IVirtualFileSystemNode.CreationTime" />
36+
public DateTimeOffset CreationTime { get; }
37+
38+
/// <inheritdoc cref="IVirtualFileSystemNode.LastAccessTime" />
39+
public DateTimeOffset LastAccessTime { get; }
40+
41+
/// <inheritdoc cref="IVirtualFileSystemNode.LastWriteTime" />
42+
public DateTimeOffset LastWriteTime { get; }
43+
44+
/// <inheritdoc cref="IVirtualFileSystemNode.IsDirectory" />
45+
public abstract bool IsDirectory { get; }
46+
47+
/// <inheritdoc cref="IVirtualFileSystemNode.IsFile" />
48+
public abstract bool IsFile { get; }
4949
}

0 commit comments

Comments
 (0)