Skip to content

Commit

Permalink
Merge pull request chucknorris#257 from macfarmw/coding-standards
Browse files Browse the repository at this point in the history
(chucknorrisGH-190) Coding Standards
  • Loading branch information
ferventcoder authored Jul 14, 2016
2 parents b8923e8 + c3b343b commit 971d047
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; EditorConfig file to support per-solution formatting.
; Use EditorConfig Visual Studio add-in to make this work.
; The add-in is available in the Visual Studio gallery.
; http://editorconfig.org

[*.cs]
indent_style = space
indent_size = 4

[*.{config,xml}]
indent_style = space
indent_size = 2
68 changes: 68 additions & 0 deletions CONTRIBUTING.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Project RoundhousE - Guide for Contributors
=======
<img src="http://github.com/ferventcoder/roundhouse/raw/master/docs/logo/RoundhousE_Logo.jpg" height="200" alt="RoundhousE - Professional Database Management" />

Thanks for your interest in contributing to the RoundhousE project! These guidelines will make it easier for the team to incorporate your submissions into the product.

# Related Guides
The guidelines for contributing to RoundhousE follow closely those for the Chocolatey project. Please start by reviewing the Chocolatey guide here.
[Chocolatey Contributing Guide](https://github.com/chocolatey/choco/blob/master/CONTRIBUTING.md)

This guide contains much of what you will need to know.

## Code Style
As noted in the Chocolatey contributors guide, it is difficult to incorporate changes if the new code has been formatted in a different style from what is already prevailing in the existing code base.
Please observe the following code style in your own contributions.

####Class, Interface, and Enum Names
Class, interface, and Enum names use **`UpperCaseStyle`** except for the automated test classes (see tests style below). Interface names do not use the letter I so they are named just like classes.

```
public interface KnownFolders
public sealed class DefaultKnownFolders : KnownFolders
public enum RecoveryMode
{
NoChange,
Simple,
Full
}
```

####Other Names
Other items are named with **`all_lower_case`** style. This includes namespaces, parameters, methods, variables, properties, fields, and constants.

```
long version_the_database(string repository_path, string repository_version);
private readonly FileSystemAccess file_system;
string current_version = database.get_version(repository_path);
```

####Automated Test Class Names
The automated test class names also use the **`all_lower_case`** style.
In addition to the case style the automated test classes use (BDD) behavior driven design naming. A review of the existing tests is the best way to get a feel for this so please look these over and use them as the basis for your own automated tests.

```
public class when_asking_the_container_to_resolve_an_item_and_it_does_not_have_the_item_registered : concern_for_container
public void should_throw_an_exception()
```
####Indentation
Indentation is 4 spaces without tabs. Braces are on a new line using BSD style.

```
namespace N
{
public class C
{
void foo();
private int prop_name { get; set; }
}
}
```

####Tooling Support
#####ReSharper
A .DotSettings file has been included in the solution for those using this tool. The ReSharper settings file contains the RoundhousE specific naming rules that differ from ReSharper defaults so if your own ReSharper settings differ significantly from the defaults the solution settings file will not cover all cases.

#####EditorConfig
The EditorConfig extension for Visual Studio can be used to control some common settings including the tab size and use of spaces instead of tabs. An .editorconfig file is included for those using this extension. The EditorConfig extension is available in the Visual Studio extensions gallery.
**NOTE:** If you are new to EditorConfig please be aware that if you open a solution with an editorconfig file the extension will change and save your Visual Studio settings to match the file. Your Visual Studio settings will not revert back to their previous values automatically.
14 changes: 14 additions & 0 deletions roundhouse.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Interfaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=LocalConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Locals/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/Policy&gt;</s:String></wpf:ResourceDictionary>

0 comments on commit 971d047

Please sign in to comment.