Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir Boulema committed Aug 2, 2023
1 parent 1eb192c commit 90d1e06
Show file tree
Hide file tree
Showing 30 changed files with 1,239 additions and 0 deletions.
179 changes: 179 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
[*.cs]

########################
# Dotnet Naming styles #
########################

# Define the pascal_case_style
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

# Define the underscore_camel_case_style
dotnet_naming_style.underscore_camel_case.capitalization = camel_case
dotnet_naming_style.underscore_camel_case.required_prefix = _

#########################
# Symbol specifications #
#########################

dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
dotnet_naming_symbols.public_or_protected_field.required_modifiers =

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.private_field.applicable_kinds = field
dotnet_naming_symbols.private_field.applicable_accessibilities = private

################
# Naming rules #
################

# Private fields are camelCase and start with _
dotnet_naming_rule.private_field_should_use_underscore_camel_case.severity = suggestion
dotnet_naming_rule.private_field_should_use_underscore_camel_case.symbols = private_field
dotnet_naming_rule.private_field_should_use_underscore_camel_case.style = underscore_camel_case

dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.symbols = public_or_protected_field
dotnet_naming_rule.public_or_protected_field_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

####################
# C# Naming styles #
####################

csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after
csharp_using_directive_placement = outside_namespace:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:warning
csharp_prefer_simple_default_expression = true:suggestion

csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent

dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion

tab_width = 4
indent_size = 4
end_of_line = crlf

####################
# Diagnostic rules #
####################

# VSTHRD200: Use "Async" suffix for async methods
dotnet_diagnostic.VSTHRD200.severity = none
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf

###############################
# Spelling Rules #
###############################
[*]
spelling_languages = en-us
spelling_checkable_types = strings,identifiers,comments
spelling_error_severity = information
spelling_exclusion_path = .\exclusion.dic
csharp_style_prefer_primary_constructors = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
98 changes: 98 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: MjmlVisualizer

on:
push:
branches:
- main
- 'feature/**'
pull_request:

env:
version: '1.0.${{ github.run_number }}'
repoUrl: ${{ github.server_url }}/${{ github.repository }}
vsixPath: ${{ github.workspace }}/MjmlVisualizer/src/MjmlVisualizer.Vsix/bin/release/net48/win/MjmlVisualizer.vsix

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update Assembly Version
uses: dannevesdantas/[email protected]
with:
version: ${{ env.version }}

- name: Update Vsix Version
uses: cezarypiatek/[email protected]
with:
version: ${{ env.version }}
vsix-manifest-file: 'src/MjmlVisualizer.Vsix/source.extension.vsixmanifest'

- name: Replace Placeholders
uses: LSVH/gha-replace-placeholders@v1
with:
include: 'src/MjmlVisualizer/Repositories/MjmlRepository.cs'
placeholders: |
MJML_USERNAME=${{ secrets.MJML_USERNAME }}
MJML_PASSWORD=${{ secrets.MJML_PASSWORD }}
- name: Setup MSBuild
uses: microsoft/[email protected]

- name: NuGet restore
run: nuget restore MjmlVisualizer.sln

- name: Build VSIX
run: msbuild MjmlVisualizer.sln /t:Rebuild /p:Configuration=Release
env:
DeployExtension: False

- name: Publish Build Artifacts
uses: actions/upload-artifact@v3
with:
name: NuGetMonitor
path: |
**/*.vsix
**/MjmlVisualizer.dll
src/MjmlVisualizer.Vsix/publish-manifest.json
readme.md
release:
if: github.ref_name == 'main'
name: Release
needs: build
runs-on: windows-latest
environment: Release
steps:
- name: Download artifact
uses: actions/download-artifact@v3

- name: Tag release
id: tag_release
uses: mathieudutour/[email protected]
with:
custom_tag: '${{ env.version }}'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_release.outputs.new_tag }}
name: ${{ steps.tag_release.outputs.new_tag }}
body: ${{ steps.tag_release.outputs.changelog }}
artifacts: "**/*.vsix"
skipIfReleaseExists: true

- name: Publish to Marketplace
uses: cezarypiatek/[email protected]
with:
extension-file: ${{ env.vsixPath }}
publish-manifest-file: MjmlVisualizer/src/MjmlVisualizer.Vsix/publish-manifest.json
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}

- name: Publish to Open VSIX Gallery
run: |
curl -L 'https://www.vsixgallery.com/api/upload?repo=${{ env.repoUrl }}&issuetracker=${{ env.repoUrl }}/issues' -F 'file=@"${{ env.vsixPath }}"'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/packages
/test/MjmlVisualizer.Test/test.mjml
.vs
bin
obj
*.user
82 changes: 82 additions & 0 deletions MjmlVisualizer.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.33927.210
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MjmlVisualizer", "src\MjmlVisualizer\MjmlVisualizer.csproj", "{BD045C2F-81E9-4C88-8722-9C48C81570A9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F80C56EF-C2FE-4BC3-9271-7FB6D30D78B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04159F9D-742C-41C6-85BE-AB01FB8E1DB2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MjmlVisualizer.Test", "test\MjmlVisualizer.Test\MjmlVisualizer.Test.csproj", "{2653FDA5-E74F-4B65-A1F8-AD1007700885}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MjmlVisualizer.Vsix", "src\MjmlVisualizer.Vsix\MjmlVisualizer.Vsix.csproj", "{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11FAA3B6-AA31-4A76-95A8-5DE33676E28A}"
ProjectSection(SolutionItems) = preProject
exclusion.dic = exclusion.dic
src\MjmlVisualizer.Vsix\publish-manifest.json = src\MjmlVisualizer.Vsix\publish-manifest.json
README.md = README.md
.github\workflows\workflow.yml = .github\workflows\workflow.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|arm64 = Debug|arm64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|arm64 = Release|arm64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|arm64.ActiveCfg = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|arm64.Build.0 = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Debug|x86.Build.0 = Debug|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|Any CPU.Build.0 = Release|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|arm64.ActiveCfg = Release|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|arm64.Build.0 = Release|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|x86.ActiveCfg = Release|Any CPU
{BD045C2F-81E9-4C88-8722-9C48C81570A9}.Release|x86.Build.0 = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|arm64.ActiveCfg = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|arm64.Build.0 = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|x86.ActiveCfg = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Debug|x86.Build.0 = Debug|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|Any CPU.Build.0 = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|arm64.ActiveCfg = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|arm64.Build.0 = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|x86.ActiveCfg = Release|Any CPU
{2653FDA5-E74F-4B65-A1F8-AD1007700885}.Release|x86.Build.0 = Release|Any CPU
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|arm64.ActiveCfg = Debug|arm64
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|arm64.Build.0 = Debug|arm64
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|x86.ActiveCfg = Debug|x86
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Debug|x86.Build.0 = Debug|x86
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|Any CPU.Build.0 = Release|Any CPU
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|arm64.ActiveCfg = Release|arm64
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|arm64.Build.0 = Release|arm64
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|x86.ActiveCfg = Release|x86
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BD045C2F-81E9-4C88-8722-9C48C81570A9} = {F80C56EF-C2FE-4BC3-9271-7FB6D30D78B5}
{2653FDA5-E74F-4B65-A1F8-AD1007700885} = {04159F9D-742C-41C6-85BE-AB01FB8E1DB2}
{EB7AAD7B-C2C3-43C4-B3D7-637E027A068D} = {F80C56EF-C2FE-4BC3-9271-7FB6D30D78B5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {81DC56AC-7E31-443D-8CAA-95E39F8CD1A4}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 90d1e06

Please sign in to comment.