Skip to content

Commit 2d54c6e

Browse files
committed
Initial commit
0 parents  commit 2d54c6e

12 files changed

+674
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
11+
[*.csproj]
12+
indent_style = space
13+
indent_size = 2

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.github/CODE_OF_CONDUCT.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
4+
5+
In particular this means:
6+
7+
> We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
8+
9+
Examples of unacceptable behavior by participants include:
10+
11+
* The use of sexualized language or imagery
12+
* Personal attacks
13+
* Trolling or insulting/derogatory comments
14+
* Public or private harassment
15+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
16+
* Other unethical or unprofessional conduct
17+
18+
For the complete set of rules and more information on the topic see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

.github/CONTRIBUTING.md

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Contributing
2+
3+
## Project Scope
4+
5+
The AngleSharp project ultimately tries to provide tools to parse, inspect, modify and interact with traditional web resources, such as HTML or CSS, for .NET development. Anything that is related to this goal will be considered. The project aims to be fully standards compliant. If your contribution is not following the standard, the chances of accepting it are limited.
6+
7+
## Code License
8+
9+
This is an open source project falling under the [MIT License](../LICENSE). By using, distributing, or contributing to this project, you accept and agree that all code within the AngleSharp project and its libraries are licensed under MIT license.
10+
11+
## Becoming a Contributor
12+
13+
Until the project has enough contributors a [BDFL](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life) model is followed. As such the sole key maintainer keeps the right to appoint GitHub members as regular project contributors. Nevertheless, usually appointing someone follows this process:
14+
15+
1. An individual contributes actively via discussions (reporting bugs, giving feedback to existing or opening new issues) and / or pull requests
16+
2. The individual is either directly asked, invited or asks for contributor rights on the project
17+
3. The individual uses the contribution rights to sustain or increase the active contributions
18+
19+
Every contributor has to sign the contributor's license agreement (CLA) to establish a legal trust between the project and its contributors.
20+
21+
## Working on AngleSharp
22+
23+
### Issue Discussion
24+
25+
Discussion of issues should be placed transparently in the issue tracker here on GitHub.
26+
27+
* [AngleSharp.Core](https://github.com/AngleSharp/AngleSharp/issues/)
28+
* [AngleSharp.Css](https://github.com/AngleSharp/AngleSharp.Css/issues/)
29+
* [AngleSharp.Io](https://github.com/AngleSharp/AngleSharp.Io/issues/)
30+
* [AngleSharp.Js](https://github.com/AngleSharp/AngleSharp.Js/issues/)
31+
* [AngleSharp.Xml](https://github.com/AngleSharp/AngleSharp.Xml/issues/)
32+
33+
### Modifying the code
34+
35+
AngleSharp and its libraries uses features from the latest versions of C# (e.g., C# 7). You will therefore need a C# compiler that is up for the job.
36+
37+
1. Fork and clone the repo.
38+
2. First try to build the AngleSharp.Core libray and see if you get the tests running.
39+
3. You will be required to resolve some dependencies via NuGet.
40+
41+
AngleSharp itself does not have dependencies, however, the tests are dependent on NUnit.
42+
43+
The build system of AngleSharp uses Cake. A bootstrap script (build.ps1 for Windows or build.sh for *nix systems) is included. Note, that at the moment AngleSharp may require NuGet 3.5, which looks for MSBuild pre-15, i.e., before Visual Studio 2017 on Windows systems. We aim to drop this requirement enitirely soon.
44+
45+
### Code Conventions
46+
47+
Most parts in the AngleSharp project are fairly straight forward. Among these are:
48+
49+
- Always use statement blocks for control statements, e.g., in a for-loop, if-condition, ...
50+
- You may use a simple (throw) statement in case of enforcing contracts on argument
51+
- Be explicit about modifiers (some files follow an older convention of the code base, but we settled on the explicit style)
52+
53+
There are a couple of rules, which are definitely not standard, but highly recommended for consistency and readability:
54+
55+
- AngleSharp uses the RHS convention, where types are always put on the right hand side if possible, i.e., preferring `var` under all circumstances
56+
- A single empty line between two non-simple statements (e.g., for-loop and if-condition) should be inserted
57+
- Types are preferred to keywords (`String` instead of `string` or `Int32` instead of `int`)
58+
- `using` statements must be inside the namespace declaration
59+
60+
### Development Workflow
61+
62+
1. If no issue already exists for the work you'll be doing, create one to document the problem(s) being solved and self-assign.
63+
2. Otherwise please let us know that you are working on the problem. Regular status updates (e.g. "still in progress", "no time anymore", "practically done", "pull request issued") are highly welcome.
64+
2. Create a new branch—please don't work in the `master` branch directly. It is reserved for releases. We recommend naming the branch to match the issue being addressed (`feature/#777` or `issue-777`).
65+
3. Add failing tests for the change you want to make. Tests are crucial and should be taken from W3C (or other specification).
66+
4. Fix stuff. Always go from edge case to edge case.
67+
5. All tests should pass now. Also your new implementation should not break existing tests.
68+
6. Update the documentation to reflect any changes. (or document such changes in the original issue)
69+
7. Push to your fork or push your issue-specific branch to the main repository, then submit a pull request against `devel`.
70+
71+
Just to illustrate the git workflow for AngleSharp a little bit more we've added the following graphs.
72+
73+
Initially, AngleSharp starts at the `master` branch. This branch should contain the latest stable (or released) version.
74+
75+
Here we now created a new branch called `devel`. This is the development branch.
76+
77+
Now active work is supposed to be done. Therefore a new branch should be created. Let's create one:
78+
79+
```
80+
git checkout -b feature/#777
81+
```
82+
83+
There may be many of these feature branches. Most of them are also pushed to the server for discussion or synchronization.
84+
85+
```
86+
git push -u origin feature/#777
87+
```
88+
89+
Now feature branches may be closed when they are done. Here we simply merge with the feature branch(es). For instance the following command takes the `feature/#777` branch from the server and merges it with the `devel` branch.
90+
91+
```
92+
git checkout devel
93+
git pull
94+
git pull origin feature/#777
95+
git push
96+
```
97+
98+
Finally, we may have all the features that are needed to release a new version of AngleSharp. Here we tag the release. For instance for the 1.0 release we use `v1.0`.
99+
100+
```
101+
git checkout master
102+
git merge devel
103+
git tag v1.0
104+
```
105+
106+
(The last part is automatically performed by our CI system.)
107+
108+
### Versioning
109+
110+
The rules of [semver](http://semver.org/) don't necessarily apply here, but we will try to stay quite close to them.
111+
112+
Prior to version 1.0.0 we use the following scheme:
113+
114+
1. MINOR versions for reaching a feature milestone potentially combined with dramatic API changes
115+
2. PATCH versions for refinements (e.g. performance improvements, bug fixes)
116+
117+
After releasing version 1.0.0 the scheme changes to become:
118+
119+
1. MAJOR versions at maintainers' discretion following significant changes to the codebase (e.g., API changes)
120+
2. MINOR versions for backwards-compatible enhancements (e.g., performance improvements)
121+
3. PATCH versions for backwards-compatible bug fixes (e.g., spec compliance bugs, support issues)
122+
123+
#### Code style
124+
125+
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.** In general most of the [C# coding guidelines from Microsoft](https://msdn.microsoft.com/en-us/library/ff926074.aspx) are followed. This project prefers type inference with `var` to explicitly stating (redundant) information.
126+
127+
It is also important to keep a certain `async`-flow and to always use `ConfigureAwait(false)` in conjunction with an `await` expression.

.github/ISSUE_TEMPLATE/bug_report.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
---
8+
9+
# Bug Report
10+
11+
## Prerequisites
12+
13+
- [ ] Can you reproduce the problem in a [MWE](https://en.wikipedia.org/wiki/Minimal_working_example)?
14+
- [ ] Are you running the latest version of AngleSharp?
15+
- [ ] Did you check the FAQs to see if that helps you?
16+
- [ ] Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., `AngleSharp.Css` for CSS support)
17+
- [ ] Did you perform a search in the issues?
18+
19+
For more information, see the `CONTRIBUTING` guide.
20+
21+
## Description
22+
23+
[Description of the bug]
24+
25+
## Steps to Reproduce
26+
27+
1. [First Step]
28+
2. [Second Step]
29+
3. [and so on...]
30+
31+
**Expected behavior:** [What you expected to happen]
32+
33+
**Actual behavior:** [What actually happened]
34+
35+
**Environment details:** [OS, .NET Runtime, ...]
36+
37+
## Possible Solution
38+
39+
[Optionally, share your idea to fix the issue]
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
---
8+
9+
# New Feature Proposal
10+
11+
## Description
12+
13+
[Description of the proposed feature]
14+
15+
## Background
16+
17+
Provide any additional background for the feature. e.g., user scenarios.
18+
19+
## Specification
20+
21+
In case of updates that adhere to specification changes, please reference the used specification.

.github/PULL_REQUEST_TEMPLATE.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Types of Changes
2+
3+
## Prerequisites
4+
5+
Please make sure you can check the following two boxes:
6+
7+
- [ ] I have read the **CONTRIBUTING** document
8+
- [ ] My code follows the code style of this project
9+
10+
## Contribution Type
11+
12+
What types of changes does your code introduce? Put an `x` in all the boxes that apply:
13+
14+
- [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
15+
- [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
16+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
17+
- [ ] My change requires a change to the documentation
18+
- [ ] I have updated the documentation accordingly
19+
- [ ] I have added tests to cover my changes
20+
- [ ] All new and existing tests passed
21+
22+
## Description
23+
24+
[Place a meaningful description here.]

0 commit comments

Comments
 (0)