├── docs
├── guides
│ ├── First-Steps.md
│ ├── Contributing.md
│ └── toc.yml
├── index.md
├── images
│ ├── favicon.png
│ ├── logo_128.png
│ └── logo_48.png
├── filter_config.yml
├── pdf
│ └── toc.yml
├── toc.yml
├── global_metadata.json
└── docfx.json
├── GitVersion.yml
├── .config
└── dotnet-tools.json
├── .gitignore
├── nuget.config
├── README.md
├── src
├── SceneGate.PC
│ └── SceneGate.PC.csproj
├── SceneGate.PC.Tests
│ └── SceneGate.PC.Tests.csproj
├── Directory.Build.targets
├── Directory.Build.props
└── SceneGate.PC.sln
├── .vscode
└── tasks.json
├── Tests.runsettings
├── LICENSE
├── CODE_OF_CONDUCT.md
├── azure-pipelines.yml
└── CONTRIBUTING.md
/docs/guides/First-Steps.md:
--------------------------------------------------------------------------------
1 | # First steps
2 |
3 | Welcome to this project!
4 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: README
3 | ---
4 |
5 | [!include[README](../README.md)]
6 |
--------------------------------------------------------------------------------
/docs/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SceneGate/Pecera/develop/docs/images/favicon.png
--------------------------------------------------------------------------------
/docs/images/logo_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SceneGate/Pecera/develop/docs/images/logo_128.png
--------------------------------------------------------------------------------
/docs/images/logo_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SceneGate/Pecera/develop/docs/images/logo_48.png
--------------------------------------------------------------------------------
/GitVersion.yml:
--------------------------------------------------------------------------------
1 | mode: ContinuousDeployment
2 | branches:
3 | develop:
4 | tag: preview
5 | increment: Patch
6 |
--------------------------------------------------------------------------------
/docs/guides/Contributing.md:
--------------------------------------------------------------------------------
1 | ---
2 | uid: CONTRIBUTING
3 | ---
4 |
5 | [!include[CONTRIBUTING](../../CONTRIBUTING.md)]
6 |
--------------------------------------------------------------------------------
/docs/filter_config.yml:
--------------------------------------------------------------------------------
1 | apiRules:
2 | # Remove object method inheritance
3 | - exclude:
4 | uidRegex: ^System\.Object
5 | type: Type
--------------------------------------------------------------------------------
/docs/pdf/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Overview
2 | href: ../index.md
3 |
4 | - name: Guides
5 | href: ../guides/toc.yml
6 |
7 | - name: API
8 | href: ../api/toc.yml
9 |
--------------------------------------------------------------------------------
/docs/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Home
2 | href: index.md
3 |
4 | - name: Guides
5 | href: guides/
6 |
7 | - name: API
8 | href: api/
9 |
10 | - name: Project
11 | href:
12 |
--------------------------------------------------------------------------------
/docs/guides/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Guides
2 | items:
3 | - name: First steps
4 | href: First-Steps.md
5 | - name: Contributing
6 | items:
7 | - name: Guidelines
8 | href: Contributing.md
9 |
--------------------------------------------------------------------------------
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "cake.tool": {
6 | "version": "0.38.4",
7 | "commands": [
8 | "dotnet-cake"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build outputs
2 | obj/
3 | bin/
4 | artifacts/
5 |
6 | # Build system
7 | tools/
8 |
9 | # Test results
10 | test_results/
11 |
12 | # Documentation output
13 | docs/_site
14 | docs/api
15 | docs/_site_pdf
16 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/global_metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "_appTitle": "SceneGate.PC",
3 | "_appFooter": "Copyright (c) 2020 SceneGate",
4 | "_appLogoPath": "images/logo_48.png",
5 | "_appFaviconPath": "images/favicon.png",
6 | "_enableSearch": true,
7 | "_enableNewTab": true,
8 | "_gitContribute": {
9 | "apiSpecFolder": "docs/apidoc",
10 | "repo": "",
11 | "branch": "develop"
12 | }
13 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SceneGate.PC
2 |
3 | File format support for the PC platform.
4 |
5 | ## Build
6 |
7 | Requirements:
8 |
9 | - .NET Core 3.1 SDK
10 |
11 | Steps:
12 |
13 | ```sh
14 | # Run these command only the first time to get the build tools
15 | dotnet tool restore
16 | dotnet cake --bootstrap
17 |
18 | # Build, test and stage artifacts
19 | dotnet cake
20 |
21 | # Just for building and testing
22 | dotnet cake --target=BuildTest
23 | ```
24 |
--------------------------------------------------------------------------------
/src/SceneGate.PC/SceneGate.PC.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "cake",
6 | "script": "Default",
7 | "group": {
8 | "kind": "build",
9 | "isDefault": true
10 | },
11 | "problemMatcher": [
12 | "$msCompile"
13 | ],
14 | "label": "Cake: Run Default"
15 | },
16 | {
17 | "type": "cake",
18 | "script": "Build",
19 | "group": "build",
20 | "problemMatcher": [
21 | "$msCompile"
22 | ],
23 | "label": "Cake: Run Build"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/src/SceneGate.PC.Tests/SceneGate.PC.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Tests.runsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ./test_results
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | cobertura
15 | [.*UnitTest]*,[.*IntegrationTest]*
16 | GeneratedCodeAttribute,ExcludeFromCodeCoverageAttribute
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 | <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Benito Palacios Sánchez
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | SceneGate
4 | SceneGate
5 | None
6 | Copyright (C) 2020 SceneGate
7 |
8 |
9 |
10 | MIT
11 |
12 |
13 |
14 |
15 | scenegate;romhacking
16 |
17 |
18 | true
19 | true
20 | snupkg
21 | true
22 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
23 |
24 |
25 |
26 |
27 | true
28 | true
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/docs/docfx.json:
--------------------------------------------------------------------------------
1 | {
2 | "metadata": [
3 | {
4 | "src": [
5 | {
6 | "files": [
7 | "SceneGate.PC/SceneGate.PC.csproj"
8 | ],
9 | "src": "../src"
10 | }
11 | ],
12 | "dest": "api",
13 | "filter": "filter_config.yml",
14 | "disableGitFeatures": false,
15 | "disableDefaultFilter": false
16 | }
17 | ],
18 | "build": {
19 | "content": [
20 | {
21 | "files": [ "api/**.yml" ]
22 | },
23 | {
24 | "files": [ "toc.yml", "index.md" ]
25 | },
26 | {
27 | "files": [ "guides/**" ]
28 | },
29 | {
30 | "files": ["README.md", "CONTRIBUTING.md"],
31 | "src": "../"
32 | }
33 | ],
34 | "resource": [
35 | {
36 | "files": ["images/**"]
37 | }
38 | ],
39 | "dest": "_site",
40 | "globalMetadataFiles": ["global_metadata.json"],
41 | "fileMetadataFiles": [],
42 | "template": [
43 | "default"
44 | ],
45 | "postProcessors": [],
46 | "markdownEngineName": "markdig",
47 | "noLangKeyword": false,
48 | "keepFileLink": false,
49 | "cleanupCacheHistory": false,
50 | "disableGitFeatures": false,
51 | "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ]
52 | },
53 | "pdf": {
54 | "content": [
55 | {
56 | "files": [ "pdf/**" ]
57 | },
58 | {
59 | "files": [ "api/**.yml" ],
60 | "exclude": [ "**/toc.yml" ]
61 | },
62 | {
63 | "files": [ "index.md" ]
64 | },
65 | {
66 | "files": [ "guides/**" ],
67 | "exclude": [ "**/toc.yml" ]
68 | },
69 | {
70 | "files": ["README.md", "CONTRIBUTING.md"],
71 | "src": "../"
72 | }
73 | ],
74 | "resource": [
75 | {
76 | "files": ["images/**"]
77 | }
78 | ],
79 | "dest": "_site_pdf"
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/SceneGate.PC.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26124.0
5 | MinimumVisualStudioVersion = 15.0.26124.0
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SceneGate.PC", "SceneGate.PC\SceneGate.PC.csproj", "{07E6EBB9-380D-4813-AFCD-E5856501929A}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SceneGate.PC.Tests", "SceneGate.PC.Tests\SceneGate.PC.Tests.csproj", "{276997DA-06FC-4C8A-AA82-92C3373C69A3}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|Any CPU = Release|Any CPU
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|x64.ActiveCfg = Debug|Any CPU
26 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|x64.Build.0 = Debug|Any CPU
27 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|x86.ActiveCfg = Debug|Any CPU
28 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Debug|x86.Build.0 = Debug|Any CPU
29 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|Any CPU.ActiveCfg = Release|Any CPU
30 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|Any CPU.Build.0 = Release|Any CPU
31 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|x64.ActiveCfg = Release|Any CPU
32 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|x64.Build.0 = Release|Any CPU
33 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|x86.ActiveCfg = Release|Any CPU
34 | {07E6EBB9-380D-4813-AFCD-E5856501929A}.Release|x86.Build.0 = Release|Any CPU
35 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
37 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|x64.ActiveCfg = Debug|Any CPU
38 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|x64.Build.0 = Debug|Any CPU
39 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|x86.ActiveCfg = Debug|Any CPU
40 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Debug|x86.Build.0 = Debug|Any CPU
41 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
42 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|Any CPU.Build.0 = Release|Any CPU
43 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|x64.ActiveCfg = Release|Any CPU
44 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|x64.Build.0 = Release|Any CPU
45 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|x86.ActiveCfg = Release|Any CPU
46 | {276997DA-06FC-4C8A-AA82-92C3373C69A3}.Release|x86.Build.0 = Release|Any CPU
47 | EndGlobalSection
48 | EndGlobal
49 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at benito356@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | branches:
3 | include:
4 | - develop
5 | - refs/pull/*
6 | tags:
7 | include:
8 | - v*
9 |
10 | variables:
11 | buildConfiguration: 'Release'
12 | netCoreSdk: '3.1.402'
13 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
14 | DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
15 |
16 | jobs:
17 | - job: 'build_lin'
18 | displayName: "[Linux] Build & Test"
19 | pool:
20 | vmImage: 'ubuntu-latest'
21 | steps:
22 | - task: UseDotNet@2
23 | displayName: "Get .NET SDK"
24 | inputs:
25 | packageType: 'sdk'
26 | version: '$(netCoreSdk)'
27 |
28 | - script: |
29 | dotnet tool restore
30 | dotnet cake --bootstrap
31 | displayName: "Install build tools"
32 |
33 | - script: dotnet cake --target=Stage-Artifacts --configuration=$(buildConfiguration) --verbosity=diagnostic
34 | displayName: "Build, test and stage artifacts"
35 |
36 | - task: PublishTestResults@2
37 | displayName: "Publish test results"
38 | inputs:
39 | testResultsFormat: 'VSTest'
40 | testResultsFiles: '*.trx'
41 | searchFolder: 'test_results'
42 | failTaskOnFailedTests: true
43 | publishRunAttachments: false
44 |
45 | - task: PublishCodeCoverageResults@1
46 | displayName: "Publish code coverage"
47 | inputs:
48 | codeCoverageTool: 'Cobertura'
49 | summaryFileLocation: 'test_results/coverage/Cobertura.xml'
50 | failIfCoverageEmpty: true
51 |
52 | # We copy the artifacts as we can't specify filters in the publish task
53 | - task: CopyFiles@2
54 | displayName: "Prepare artifacts"
55 | inputs:
56 | sourceFolder: 'artifacts'
57 | contents: |
58 | *.zip
59 | *.nupkg
60 | *.snupkg
61 | _site/**
62 | targetFolder: $(Build.ArtifactStagingDirectory)
63 |
64 | - task: PublishBuildArtifacts@1
65 | displayName: "Publish artifacts"
66 | inputs:
67 | PathtoPublish: '$(Build.ArtifactStagingDirectory)'
68 | ArtifactName: 'artifacts'
69 | publishLocation: 'Container'
70 |
71 | - job: 'build_mac'
72 | displayName: "[MacOS] Build & Test"
73 | pool:
74 | vmImage: 'macOs-latest'
75 | steps:
76 | - task: UseDotNet@2
77 | displayName: "Get .NET SDK"
78 | inputs:
79 | packageType: 'sdk'
80 | version: '$(netCoreSdk)'
81 |
82 | - script: |
83 | dotnet tool restore
84 | dotnet cake --bootstrap
85 | displayName: "Install build tools"
86 |
87 | - script: dotnet cake --target=BuildTest --configuration=$(buildConfiguration) --verbosity=diagnostic
88 | displayName: "Build & test"
89 |
90 | - task: PublishTestResults@2
91 | displayName: "Publish test results"
92 | inputs:
93 | testResultsFormat: 'VSTest'
94 | testResultsFiles: '*.trx'
95 | searchFolder: 'test_results'
96 | failTaskOnFailedTests: true
97 | publishRunAttachments: false
98 |
99 | - job: 'build_win'
100 | displayName: "[Windows] Build & Test"
101 | pool:
102 | vmImage: 'windows-latest'
103 | steps:
104 | - task: UseDotNet@2
105 | displayName: "Get .NET SDK"
106 | inputs:
107 | packageType: 'sdk'
108 | version: '$(netCoreSdk)'
109 |
110 | - script: |
111 | dotnet tool restore
112 | dotnet cake --bootstrap
113 | displayName: "Install build tools"
114 |
115 | - script: dotnet cake --target="BuildTest" --configuration=$(buildConfiguration) --verbosity=diagnostic
116 | displayName: "Build & test"
117 |
118 | - task: PublishTestResults@2
119 | displayName: "Publish test results"
120 | inputs:
121 | testResultsFormat: 'VSTest'
122 | testResultsFiles: '*.trx'
123 | searchFolder: 'test_results'
124 | failTaskOnFailedTests: true
125 | publishRunAttachments: false
126 |
127 | - job: 'preview_release'
128 | displayName: 'Publish preview release'
129 | pool:
130 | vmImage: 'ubuntu-latest'
131 | dependsOn: ['build_win', 'build_lin', 'build_mac']
132 | condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))"
133 | steps:
134 | - task: DownloadBuildArtifacts@0
135 | displayName: 'Get build artifacts'
136 | inputs:
137 | buildType: 'current'
138 | downloadType: 'single'
139 | artifactName: 'artifacts'
140 | downloadPath: '$(Build.ArtifactStagingDirectory)'
141 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to the project
2 |
3 | Thanks for taking the time to contribute! :sparkles:
4 |
5 | In this document you will find all the information you need to make sure
6 | the project continues to be the high-quality product we want to be!
7 |
8 | ## Reporting issues
9 |
10 | ### Issues
11 |
12 | When reporting a problem, be as specific as possible. Ideally, you should
13 | provide an small snippet of code that reproduces the issue. Try to provide also
14 | the following information:
15 |
16 | * OS: Linux / Windows / Mac OS
17 | * Runtime: .NET Framework, Mono, .NET Core
18 | * Version of the product
19 | * Stacktrace if any
20 | * What's happening and what you expect to happen
21 |
22 | ### Features
23 |
24 | If you want to ask for a new feature, first make sure it hasn't been reported
25 | yet by using the search box in the issue tab. Make sure that the feature aligns
26 | with the direction of the project.
27 |
28 | ## Pull Request
29 |
30 | Before starting a pull request, create an issue requesting the feature you would
31 | like to see and implement. If you are fixing a bug, create also an issue to be
32 | able to track the problem. State that you would like to work on that. The team
33 | will reply to the issue as soon as possible, discussing the proposal if needed.
34 | This guarantee that later on the Pull Request we don't reject the proposal
35 | without having a discussion first and we don't waste time.
36 |
37 | In general, the process to create a pull request is:
38 |
39 | 1. Create an issue describing the bug or feature and state you would like to
40 | work on that.
41 | 2. The team will cheer you and/or discuss with you the issue.
42 | 3. Fork the project.
43 | 4. Clone your forked project and create a git branch.
44 | 5. Make the necessary code changes in as many commits as you want. The commit
45 | message should follow this convention:
46 |
47 | ```plain
48 | :emoji: Short description #IssueID
49 |
50 | Long description if needed.
51 | ```
52 |
53 | 6. Create a pull request. After reviewing your changes and making any new
54 | commits if needed, the team will approve and merge it.
55 |
56 | For a complete list of emoji description see
57 | [this repository](https://github.com/slashsBin/styleguide-git-commit-message#suggested-emojis).
58 |
59 | ## Code Guidelines
60 |
61 | We follow the following standard guidelines with custom changes:
62 |
63 | * [Mono Code Guidelines](https://raw.githubusercontent.com/mono/website/gh-pages/community/contributing/coding-guidelines.md).
64 | * [Microsoft Framework Design Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/)
65 | * [Microsoft C# Coding Convetions](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions).
66 |
67 | As the
68 | [mono team says](https://www.mono-project.com/community/contributing/coding-guidelines/#performance-and-readability):
69 |
70 | * It is more important to be correct than to be fast.
71 | * It is more important to be maintainable than to be fast.
72 | * Fast code that is difficult to maintain is likely going to be looked down upon.
73 |
74 | And don't miss [The Zen of Python](https://www.python.org/dev/peps/pep-0020/#id3):
75 |
76 | ```plain
77 | Beautiful is better than ugly.
78 | Explicit is better than implicit.
79 | Simple is better than complex.
80 | Complex is better than complicated.
81 | Flat is better than nested.
82 | Sparse is better than dense.
83 | Readability counts.
84 | Special cases aren't special enough to break the rules.
85 | Although practicality beats purity.
86 | Errors should never pass silently.
87 | Unless explicitly silenced.
88 | In the face of ambiguity, refuse the temptation to guess.
89 | There should be one-- and preferably only one --obvious way to do it.
90 | Although that way may not be obvious at first unless you're Dutch.
91 | Now is better than never.
92 | Although never is often better than *right* now.
93 | If the implementation is hard to explain, it's a bad idea.
94 | If the implementation is easy to explain, it may be a good idea.
95 | Namespaces are one honking great idea -- let's do more of those!
96 | ```
97 |
98 | ### Quality
99 |
100 | We focus on code-quality to make ours and others life easier. For that reason:
101 |
102 | * :heavy_check_mark: **DO** write documentation for any public type and field.
103 | * :heavy_check_mark: **DO** write a test for all the possible code branches of
104 | your methods. Use a TDD approach.
105 | * :heavy_check_mark: **DO** seek for 100% test coverage.
106 | * :heavy_check_mark: **DO** seek for compiler warning free code.
107 | * :heavy_check_mark: **DO** check the code with StyleCop for style issues.
108 | * :heavy_check_mark: **DO** check the code with Gendarme for design issues.
109 | * :heavy_check_mark: **DO** review the results of SonarQube in the Pull Request.
110 | * :heavy_check_mark: **DO** make sure the CI pass.
111 |
112 | ### Style Guidelines
113 |
114 | #### Indentation
115 |
116 | * :heavy_check_mark: **DO** use **spaces** with an indentation level of 4 spaces.
117 | * :x: **DO NOT** use tabs.
118 |
119 | #### New lines
120 |
121 | * :heavy_check_mark: **DO** use Unix new lines: `\n` instead of Windows style
122 | `\r\n`. In general, Git will handle that for you.
123 | * :heavy_check_mark: **DO** make sure there is an empty line at the end of the
124 | file. This ensure the latest line ends with the new line character and adding
125 | new lines after it won't show that line as changed in the diff.
126 |
127 | #### Line length
128 |
129 | * :heavy_check_mark: **DO** use a limit of 80 columns. If you need to wrap,
130 | move to the next line with one extra indentation level.
131 | * :heavy_check_mark: **DO** put all the arguments in a new line if they don't
132 | fit.
133 | * :heavy_check_mark: **DO** use local variables to make small conditions.
134 |
135 | ```csharp
136 | void Method(
137 | int a,
138 | string b,
139 | int c)
140 | {
141 | OtherMethod(
142 | a,
143 | b,
144 | c);
145 |
146 | bool z = (a > 3) && (a < 5);
147 | bool w = b.StartsWith("hello");
148 | if (z && w) {
149 | Code();
150 | }
151 | }
152 | ```
153 |
154 | #### Layout
155 |
156 | * :heavy_check_mark: **DO** define a type (class / struct / enum) per file.
157 | * :heavy_check_mark: **DO** separate methods and properties with new lines.
158 | * :heavy_check_mark: **DO** place the elements in this order:
159 | private fields, constructors, properties, methods, nested types. Place first
160 | static fields and order by visibility: public, protected, private.
161 |
162 | #### Spacing rules
163 |
164 | * :x: **DO NOT** leave any trailing spaces.
165 | * :x: **DO NOT** use space before opening parenthesis calling methods or
166 | indexers, between the parenthesis and the arguments or between the generic
167 | types.
168 |
169 | ```csharp
170 | Method ( a );
171 | array [ 10 ];
172 | var list = new List ();
173 | ```
174 |
175 | * :heavy_check_mark: **DO** use the following convention:
176 |
177 | ```csharp
178 | Method(a);
179 | array[10];
180 | var list = new List();
181 | ```
182 |
183 | * :heavy_check_mark: **DO** use spaces and parenthesis for clarity in math
184 | operations:
185 |
186 | ```csharp
187 | int b = (a + (5 * 2)) / (3 + 3);
188 | ```
189 |
190 | * :heavy_check_mark: **DO** indent `case` statements:
191 |
192 | ```csharp
193 | switch (a) {
194 | case 3:
195 | c = "hello";
196 | break;
197 |
198 | case 5:
199 | c = "world";
200 | break;
201 |
202 | default:
203 | throw new Exception();
204 | }
205 | ```
206 |
207 | #### Brace position
208 |
209 | * :heavy_check_mark: **DO** put the opening brace on the same line for
210 | conditions, loops and try-catch.
211 |
212 | ```csharp
213 | if (a) {
214 | Code();
215 | Code();
216 | } else if (b) {
217 | Code();
218 | } else {
219 | Code();
220 | }
221 |
222 | try {
223 | Something();
224 | } catch (ArgumentNullException ex) {
225 | Something();
226 | } finally {
227 | Something();
228 | }
229 |
230 | for (int i = 0; i < 2; i++) {
231 | Something();
232 | }
233 | ```
234 |
235 | * :heavy_check_mark: **DO** use braces for one line conditions and loops. This
236 | improves readability and avoid having changed lines just to add the brace when
237 | it requires extra logic. The exception is for one line conditions for argument
238 | checking.
239 |
240 | ```csharp
241 | if (a) {
242 | Code();
243 | }
244 | ```
245 |
246 | * :heavy_check_mark: **DO** put the brace in a new line when defining the
247 | namespace, a type or a method.
248 |
249 | ```csharp
250 | namespace Program.Text
251 | {
252 | public class Abc
253 | {
254 | public void MyMethod()
255 | {
256 | }
257 | }
258 | }
259 | ```
260 |
261 | * :heavy_check_mark: **DO** put the brace in the same line for properties and
262 | indexers.
263 |
264 | ``` csharp
265 | public int Property {
266 | get {
267 | return value;
268 | }
269 | }
270 | ```
271 |
272 | * :heavy_check_mark: **DO** put each brace on a new line for empty methods.
273 |
274 | ``` csharp
275 | void EmptyMethod()
276 | {
277 | }
278 | ```
279 |
280 | #### Multiline comments
281 |
282 | * :heavy_check_mark: **DO** use always double slash comments.
283 |
284 | ```csharp
285 | // Blah
286 | // Blah again
287 | // and another Blah
288 | ```
289 |
290 | ### Properties
291 |
292 | * :x: **DO NOT** use public variables under any circumstance.
293 |
294 | * :heavy_check_mark: **DO** use static properties for constants.
295 |
296 | * :heavy_check_mark: **DO** put the getter and setter in a new line for
297 | automatic or one line properties.
298 |
299 | ```csharp
300 | public int Property {
301 | get { return value; }
302 | set { x = value; }
303 | }
304 |
305 | public int Text {
306 | get;
307 | private set;
308 | }
309 | ```
310 |
311 | ### File headers
312 |
313 | * :heavy_check_mark: **DO** put the license in the file header with this format:
314 |
315 | ```csharp
316 | //
317 | // .cs
318 | //
319 | // Author:
320 | //
321 | //
322 | // Copyright (c)
323 | //
324 | // Permission is hereby granted, free of charge, to any person obtaining a copy
325 | // of this software and associated documentation files (the "Software"), to deal
326 | // in the Software without restriction, including without limitation the rights
327 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
328 | // copies of the Software, and to permit persons to whom the Software is
329 | // furnished to do so, subject to the following conditions:
330 | //
331 | // The above copyright notice and this permission notice shall be included in
332 | // all copies or substantial portions of the Software.
333 | //
334 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
335 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
336 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
337 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
338 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
339 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
340 | // THE SOFTWARE.
341 | ```
342 |
343 | ### Naming
344 |
345 | * :heavy_check_mark: **DO** use **always** camel casing.
346 |
347 | ```csharp
348 | void Method(string myArgument)
349 |
350 | class MyClass
351 | {
352 | string myString;
353 | int veryImportantValue;
354 | }
355 | ```
356 |
357 | * :x: **DO NOT** use `m_` or `_` as prefixes for private instance members. The
358 | private visibility was created for that, really.
359 |
360 | ### Keyword `this`
361 |
362 | * :x: **DO NOT** use `this` if it's not needed.
363 | * :heavy_check_mark: **DO** use `this` if the method has an argument with the
364 | same name.
365 |
366 | ```csharp
367 | class Foo
368 | {
369 | int bar;
370 |
371 | public Foo(int bar)
372 | {
373 | this.bar = bar;
374 | }
375 |
376 | void Update(int newValue)
377 | {
378 | bar = newValue;
379 | Method();
380 | }
381 |
382 | public void Method()
383 | {
384 | }
385 | }
386 | ```
387 |
388 | ### Keyword `var`
389 |
390 | * :heavy_check_mark: **DO** use the `var` on the left-hand side of an assignment
391 | when the type name is repeated on the right hand side:
392 |
393 | ``` csharp
394 | var monkeyUUID = new NSUuid(uuid);
395 | NSUuid something = RetrieveUUID();
396 | ```
397 |
398 | ### Initializing instances
399 |
400 | * :heavy_check_mark: **DO** use the C# syntax to initialize instances.
401 |
402 | ```csharp
403 | var x = new Foo {
404 | Label = "This",
405 | Color = Color.Red
406 | };
407 |
408 | string[] array = { "a", "b", "c" };
409 | var array2 = new string[] { "d", "e", "f" };
410 |
411 | var list = new List {
412 | "hello",
413 | "world"
414 | };
415 |
416 | var dict = new Dictionary {
417 | { "hello": 0 },
418 | { "world": 1 }
419 | };
420 | ```
421 |
422 | ### Redundant visibility
423 |
424 | * :x: **DO NOT** use the `private` keyword to indicate internal fields since
425 | it's already the default visibility.
426 |
427 | ### Usings
428 |
429 | * :heavy_check_mark: **DO** put the `using` inside the namespace.
430 | * :heavy_check_mark: **DO** include all the namespaces you are using.
431 |
432 | * :heavy_check_mark: **DO** use the `using` statement for `IDisposable` types.
433 |
434 | ### Built-in types
435 |
436 | * :heavy_check_mark: **DO** use the built-in type alias instead of the class
437 | names.
438 |
439 | ```csharp
440 | int a = 5;
441 | long b = 5;
442 | string c = "hello";
443 | string d = int.Parse("5");
444 | ```
445 |
446 | #### Integers
447 |
448 | * :heavy_check_mark: **DO** try to avoid unsigned integers in public method
449 | arguments and properties. Some .NET language doesn't support them.
450 |
451 | #### Strings
452 |
453 | * :heavy_check_mark: **DO** use the new string interpolation:
454 |
455 | ```csharp
456 | int a = 5;
457 | string b = $"The result is {a}";
458 | ```
459 |
460 | * :heavy_check_mark: **DO** use the `StringBuilder` class when creating strings
461 | with many operations.
462 |
--------------------------------------------------------------------------------