Skip to content

Commit 3de4fde

Browse files
author
Jos Hickson
committed
Added initial templates and documentation.
1 parent c0953d9 commit 3de4fde

File tree

14 files changed

+1660
-2
lines changed

14 files changed

+1660
-2
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ignore everything
2+
3+
*
4+
5+
# Except directories
6+
7+
!*/
8+
9+
# and
10+
11+
!.gitignore
12+
!LICENSE
13+
!*.md
14+
!*.json
15+
!*.snippet
16+
!*.DotSettings

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# How to contribute
2+
3+
One of the easiest ways to contribute is to participate in discussions and discuss issues. You can also contribute by submitting pull requests with changes.
4+
5+
## Filing issues
6+
The best way to get your bug fixed is to be as detailed as you can be about the problem.
7+
Providing a minimal example with steps to reproduce the problem is ideal.
8+
Here are questions you can answer before you file a bug to make sure you're not missing any important information.
9+
10+
1. Did you include the snippet of broken code in the issue?
11+
2. What are the *EXACT* steps to reproduce this problem?
12+
3. What IDE are you using?
13+
14+
GitHub supports [markdown](https://help.github.com/articles/github-flavored-markdown/) in issues, so when filing bugs make sure you check the formatting before clicking submit.
15+
16+
## Contributing templates
17+
Make sure you can build the code that a template generates.
18+
Familiarize yourself with the C# coding conventions in existing templates.
19+
20+
If you don't know what a pull request is read this article: https://help.github.com/articles/using-pull-requests.
21+
22+
Before submitting a template or substantial contribution please discuss it with the team and ensure it follows the product roadmap. You might also read these two blog posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. Note that all submissions will be rigorously reviewed and tested by the Winton team prior to merging.
23+
24+
Here's a few things you should always do when making changes to the code base:
25+
26+
**Engineering guidelines**
27+
28+
Please follow the existing style used in this project.
29+
30+
**Commit/Pull Request Format**
31+
32+
```
33+
Summary of the changes (Less than 80 chars)
34+
- Detail 1
35+
- Detail 2
36+
37+
Addresses #bugnumber (in this specific format)
38+
```
39+
40+
**Tests**
41+
42+
- Test descriptions need to be provided for every bug/feature that is completed.

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
# Winton.CSharp.Code.Templates
2-
C# code templates for use with various IDEs and tools
1+
# Winton C# Code Templates
2+
3+
This repository contains C# code templates for use with various IDEs and tools.
4+
5+
## Usage
6+
7+
To use the templates in this repository first clone or download it and then follow the instructions listed
8+
below for the different template types available.
9+
10+
## Strong types
11+
12+
File templates and code snippets for the strong typing pattern described on
13+
[Winton's Tech Blog](https://tech.winton.com/blog/2017/05/strong-typing-in-csharp)
14+
can be accessed for the following tools:
15+
16+
* ReSharper instructions:
17+
* [Live templates](ReSharper/LiveTemplates/StrongTyping/ReadMe.md)
18+
* [File templates](ReSharper/FileTemplates/StrongTyping/ReadMe.md)
19+
* [Visual Studio Code instructions](VisualStudioCode/CodeSnippets/StrongTyping/ReadMe.md)
20+
* [Visual Studio instructions](VisualStudio/CodeSnippets/StrongTyping/ReadMe.md)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Strong typing file templates for ReSharper
2+
3+
Here file templates can be found for:
4+
5+
* A strong type wrapping a `string`
6+
* A strong type wrapping a value type
7+
* A comparable strong type wrapping a `string`
8+
* A comparable strong type wrapping a value type
9+
10+
The "comparable" types differ from the non-comparable types in that they implement
11+
`IComparable<>` and `IComparable` as well as `IEquatable<>`.
12+
13+
## Installation
14+
15+
The `strong_types.DotSettings` template file needs to be imported into ReSharper.
16+
This can be done from the ReSharper Templates Explorer found in Visual Studio via
17+
__ReSharper -> Tools -> Templates Explorer__.
18+
Navigate to the __File Templates__ tab in the explorer, click on the "Import..." icon and select the
19+
`strong_types.DotSettings` file.
20+
The templates will appear in the "Winton" category.

ReSharper/FileTemplates/StrongTyping/strong_types.DotSettings

Lines changed: 403 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Strong typing live templates for ReSharper
2+
3+
Here live templates can be found for:
4+
5+
* A strong type wrapping a `string` [short-cut: __strongstr__]
6+
* A strong type wrapping a value type [short-cut: __strongval__]
7+
* A comparable strong type wrapping a `string` [short-cut: __cmpstrongstr__]
8+
* A comparable strong type wrapping a value type [short-cut: __cmpstrongval__]
9+
10+
The "comparable" types differ from the non-comparable types in that they implement
11+
`IComparable<>` and `IComparable` as well as `IEquatable<>`.
12+
13+
## Installation
14+
15+
The `strong_types.DotSettings` template file needs to imported into ReSharper.
16+
This can be done from the ReSharper Templates Explorer found in Visual Studio via
17+
__ReSharper -> Tools -> Templates Explorer__.
18+
Navigate to the __Live Templates__ tab in the explorer, click on the "Import..." icon and select the
19+
`strong_types.DotSettings` file.
20+
The templates will appear in the "Winton" category.
21+
You should now be able to access the code snippets in a C# file via the short-cuts named above.

0 commit comments

Comments
 (0)