Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Jun 8, 2017
1 parent 3aefd71 commit b42e66e
Show file tree
Hide file tree
Showing 777 changed files with 59,252 additions and 3 deletions.
134 changes: 134 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# http://EditorConfig.org

# This file is the top-most EditorConfig file
root = true

# All Files
[*]
charset = utf-8
end_of_line = crlf
indent_style = space
indent_size = 4
insert_final_newline = false
trim_trailing_whitespace = true

# Solution Files
[*.sln]
indent_style = tab

# XML Project Files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Configuration Files
[*.{json,xml,props,targets,nuspec,resx,ruleset,config,yml}]
indent_size = 2

# Markdown Files
[*.md]
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,ts,css,scss}]
indent_size = 2
insert_final_newline = true

# Bash Files
[*.sh]
end_of_line = lf

# Dotnet Code Style Settings (See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference)
[*.{cs,vb}]
dotnet_sort_system_directives_first = true:warning
dotnet_style_coalesce_expression = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_null_propagation = true:warning
dotnet_style_object_initializer = true:warning
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_qualification_for_event = true:warning
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_property = true:warning

# C# Code Style Settings (See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference)
[*.cs]
# Indentation Options (Undocumented)
csharp_indent_block_contents = true:warning
csharp_indent_braces = false:warning
csharp_indent_case_contents = true:warning
csharp_indent_switch_labels = true:warning
csharp_indent_labels = no_change:warning
# Style Options
csharp_style_conditional_delegate_call = true:warning
csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_constructors = true:warning
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_methods = true:warning
csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:warning
csharp_style_inlined_variable_declaration = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_throw_expression = true:warning
csharp_style_var_elsewhere = true:warning
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
# New Line Options
csharp_new_line_before_catch = true:warning
csharp_new_line_before_else = true:warning
csharp_new_line_before_finally = true:warning
csharp_new_line_before_members_in_anonymous_types = true:warning
csharp_new_line_before_members_in_object_initializers = true:warning
# BUG: Warning level cannot be set https://github.com/dotnet/roslyn/issues/18010
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true:warning
# Spacing Options (Undocumented)
csharp_space_after_cast = false:warning
csharp_space_after_colon_in_inheritance_clause = true:warning
csharp_space_after_comma = true:warning
csharp_space_after_dot = false:warning
csharp_space_after_keywords_in_control_flow_statements = true:warning
csharp_space_after_semicolon_in_for_statement = true:warning
csharp_space_around_binary_operators = before_and_after:warning
csharp_space_around_declaration_statements = do_not_ignore:warning
csharp_space_before_colon_in_inheritance_clause = true:warning
csharp_space_before_comma = false:warning
csharp_space_before_dot = false:warning
csharp_space_before_semicolon_in_for_statement = false:warning
csharp_space_before_open_square_brackets = false:warning
csharp_space_between_empty_square_brackets = false:warning
csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning
csharp_space_between_method_declaration_parameter_list_parentheses = false:warning
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning
csharp_space_between_method_call_name_and_opening_parenthesis = false:warning
csharp_space_between_method_call_parameter_list_parentheses = false:warning
csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning
csharp_space_between_square_brackets = false:warning
csharp_space_between_parentheses = expressions:warning
# Wrapping Options (Undocumented)
csharp_preserve_single_line_blocks = true:warning
csharp_preserve_single_line_statements = false:warning
# Naming Rules (Undocumented)
# Constant Fields Should Be PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Public Members Must Be Capitalized
# dotnet_naming_rule.public_members_must_be_capitalized.severity = warning
# dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
# dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
# dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
# dotnet_naming_symbols.public_symbols.required_modifiers = public,internal,protected,protected_internal
# dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
# Private, Protected and Internal Fields Should Be camelCase
# dotnet_naming_rule.camel_case_for_private_internal_fields.severity = warning
# dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
# dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
# dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
# dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, protected, internal
# dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Ignore Visual Studio temporary files, build results, and
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
Expand Down Expand Up @@ -286,3 +286,5 @@ __pycache__/
*.btm.cs
*.odx.cs
*.xsd.cs

tools/
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Travis CI documentation https://docs.travis-ci.com/

language: csharp
os:
- linux
- osx

# .NET CLI require Ubuntu 14.04
sudo: required
dist: trusty
addons:
apt:
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- zlib1g

# .NET CLI requires OSX 10.11
osx_image: xcode7.2

# Ensure that .NET Core is installed
dotnet: 1.0.1
# Ensure Mono is installed
mono: latest

env:
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
# Disable sending usage data to Microsoft
- DOTNET_CLI_TELEMETRY_OPTOUT=true

# You must run the following command for Travis to be able to have permissions to execute the shell script below
# git update-index --chmod=+x build.sh
script:
# Skip running tests due to tooling bug https://github.com/dotnet/cli/issues/3073
- ./build.sh --target Test
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# All contributions, however small are valued!

# Steps to contribute

If you want to make If it's a small change, go ahead and raise a PR, otherwise follow these steps:

1. View the [Projects](https://github.com/RehanSaeed/Schema.NET/projects) page to see a To-Do list of things to be implemented.
2. Raise an issue or comment on an existing issue with what you want to contribute.
3. When you get the go ahead, follow the coding guidelines and raise a PR.

# Coding Guidelines

- Projects use StyleCop to produce style warnings. Please fix all warnings in any code you submit.
- Write unit tests for any code written.

# Special Thanks

As thanks for all contributions, your username will be posted to the front page of the project with a short description of how you helped.
Binary file added Key.snk
Binary file not shown.
82 changes: 82 additions & 0 deletions MinimumRecommendedRulesWithStyleCop.ruleset
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Rules for ClassLibrary1" Description="Code analysis rules for ClassLibrary1.csproj." ToolsVersion="14.0">
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1600" Action="None" />
<Rule Id="SA1601" Action="None" />
<Rule Id="SA1602" Action="None" />
<Rule Id="SA1623" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1634" Action="None" />
<Rule Id="SA1635" Action="None" />
<Rule Id="SA1636" Action="None" />
<Rule Id="SA1637" Action="None" />
<Rule Id="SA1638" Action="None" />
<Rule Id="SA1640" Action="None" />
<Rule Id="SA1641" Action="None" />
<Rule Id="SA1652" Action="None" />
</Rules>
</RuleSet>
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Schema.NET
Schema.org turned into strongly typed C# classes for use in .NET
![Schema.NET Banner](https://raw.githubusercontent.com/RehanSaeed/Schema.NET/master/Images/Banner.png)

Schema.org turned into strongly typed C# classes for use in .NET.

## Continuous Integration

| Name | Operating System | Status |
| :--- | :--- | :--- |
| AppVeyor | Windows | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/aknwu9sil3dv3im0?svg=true)](https://ci.appveyor.com/project/RehanSaeed/Schema.NET) |
| Travis CI | Linux & Mac | [![Travis CI Build Status](https://img.shields.io/travis/RehanSaeed/Schema.NET.svg?maxAge=3600&label=travis)](https://travis-ci.org/RehanSaeed/Schema.NET) |

## NuGet Packages

| Name | NuGet | MyGet |
| :--- | :--- | :--- |
| [Schema.NET](https://www.nuget.org/packages/Schema.NET/) | [![Schema.NET NuGet Package](https://img.shields.io/nuget/v/Schema.NET.svg)](https://www.nuget.org/packages/Schema.NET) | [![Schema.NET MyGet Package](https://img.shields.io/myget/rehansaeed/v/Schema.NET.svg)](http://myget.org/gallery/Schema.NET) |
54 changes: 54 additions & 0 deletions Schema.NET.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.6
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{719809C2-A551-4C4A-9EFD-B10FB5E35BC0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F20E2797-D1E3-4321-91BB-FAE54954D2A0}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
build.cake = build.cake
build.ps1 = build.ps1
build.sh = build.sh
Key.snk = Key.snk
LICENSE = LICENSE
MinimumRecommendedRulesWithStyleCop.ruleset = MinimumRecommendedRulesWithStyleCop.ruleset
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Tool", "Source\Schema.NET.Tool\Schema.NET.Tool.csproj", "{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Schema.NET", "Source\Schema.NET\Schema.NET.csproj", "{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{7EDFA103-DB69-4C88-9DE4-97ADBF8253A1}"
ProjectSection(SolutionItems) = preProject
CONTRIBUTING.md = CONTRIBUTING.md
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Release|Any CPU.Build.0 = Release|Any CPU
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Debug|Any CPU.Build.0 = Debug|Any CPU
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Release|Any CPU.ActiveCfg = Release|Any CPU
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
EndGlobalSection
EndGlobal
23 changes: 23 additions & 0 deletions Source/Schema.NET.Tool/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Schema.NET.Tool
{
using System;
using System.Collections.Generic;
using System.Linq;

public static class EnumerableExtensions
{
public static IEnumerable<T> Traverse<T>(T node, Func<T, IEnumerable<T>> children)
{
yield return node;

var childNodes = children(node);
if (childNodes != null)
{
foreach (var childNode in childNodes.SelectMany(x => Traverse(x, children)))
{
yield return childNode;
}
}
}
}
}
Loading

0 comments on commit b42e66e

Please sign in to comment.