Skip to content

Commit 109eb50

Browse files
committed
Add a Developer Certificate of Origin and a CONTRIBUTING.md file
1 parent 80d7a4d commit 109eb50

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed

CONTRIBUTING.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Contributing to xml-dtd
2+
3+
You can contribute to the xml-dtd project by raising issues and/or sending `git`
4+
pull requests.
5+
6+
<br/>
7+
8+
## Report issues
9+
10+
If you find any issue with the software or want to ask for an enhancement, use
11+
the Github's [issue tracker](https://github.com/css4j/xml-dtd/issues).
12+
13+
Note that some issues may correspond to other subprojects, for example
14+
[carte-util issues](https://github.com/css4j/carte-util/issues).
15+
16+
<br/>
17+
18+
## Pull requests
19+
20+
To contribute code to this project it is recommended to open an issue first,
21+
explaining the rationale for the changes that you want to implement. Then, in
22+
the title of the pull request (PR) you can include a reference like "fixes #NN"
23+
where NN is the issue number. And it is generally a good idea to base your PR on
24+
a branch that was named after the issue; for example your branch could be named
25+
`issue-14`.
26+
27+
A PR should only try to fix a single issue, unless it fixes two or more issues
28+
that are very related or effectively the same. And if a commit has two or more
29+
different purposes, it is often better to split it in multiple commits; tools
30+
like the _Git GUI_ are particularly useful for that.
31+
32+
<br/>
33+
34+
### Tests
35+
36+
All PRs should come with one or more JUnit tests unless the change is a small,
37+
obviously correct fix. Ideally, tests should provide a full coverage of the new
38+
code, except for cases like multiple equivalent comparisons, exceptions that are
39+
very hard to trigger or never thrown (or put as a theoretical safeguard), etc.
40+
However, even one test is better than nothing.
41+
42+
1) For consistency, the names of classes that contain tests (i.e. with `@Test`
43+
annotation(s)) must end with `Test`. This makes easier to tell the actual tests
44+
apart from their helper classes.
45+
46+
2) It is acceptable to mix tests and main source code in the same commit, as it
47+
is immediately obvious to the reviewers which are which, and the tests offer an
48+
insight of what the commit is trying to achieve. You do not need to mention the
49+
tests in the commit message.
50+
51+
3) Tests should not involve remote network connections, unless the subject of
52+
that test is to check the connection or its security. It should be possible to
53+
disable those tests with the `TestConfig.REMOTE_TESTS` toggle.
54+
55+
<br/>
56+
57+
### Code style
58+
59+
The code style could be summarized by the following points:
60+
61+
- Indent by tabs, not spaces. The automated formatting provided by the Eclipse
62+
IDE is often used.
63+
64+
- `if`-`else` blocks should always use curly braces, even if a single line of
65+
code is involved.
66+
67+
- Long, descriptive variable names are preferred.
68+
69+
- Add comments to explain what the code is trying to do, but avoiding useless
70+
prose that just mimics the code, like _"check if foo is larger than 1"_ as a
71+
comment to `if (foo > 1)`.
72+
73+
- Public and protected methods must have documentation comments.
74+
75+
- Avoid trailing whitespace except for empty lines in Javadoc comments.
76+
77+
- Classes and methods should have the minimum visibility that they require.
78+
A method should not have `protected` visibility when being package-visible could
79+
be enough, unless subclasses in other packages would naturally extend it. For
80+
complex package-level or inner classes, it is acceptable to have `protected`
81+
methods as a mean to document which ones are intended to be overridden by other
82+
classes. (In that case, protected methods do not appear in the Javadocs and
83+
therefore are not part of the API)
84+
85+
<br/>
86+
87+
### Copyright and attribution
88+
89+
All contributions are submitted under a [Developer Certificate of Origin](DeveloperCertificateOfOrigin.txt).
90+
Although every author maintains their copyright, in case that code from this
91+
project —including your contribution(s)— is used in a way that is deemed as a
92+
license infringement, you are —in principle— not opposed to be represented by
93+
the maintainer of this project in any legal proceedings intended to protect the
94+
license of this project.
95+
96+
If you modify a source file that happens to have an `@author` tag with the
97+
author name, feel free to remove that field and let `git blame` handle the
98+
attribution.
99+
100+
It is assumed that if you put an `@author` field with your name in a new file,
101+
the same criteria would apply.
102+
103+
<br/>
104+
105+
## Licensing
106+
107+
Your contributions are to be submitted according to the licensing of this
108+
project, see the `LICENSE.txt` and `NOTICE.txt` files for more information.
109+
110+
<br/>
111+
112+
## Distribution
113+
114+
This project [is not being submitted to the Maven Central repository](https://groups.google.com/g/css4j/c/op5jIoINb3M/m/IiiN-LfkDAAJ)
115+
and this is something known to deter some contributors, thus being a relevant
116+
information to put here.

DeveloperCertificateOfOrigin.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5+
1 Letterman Drive
6+
Suite D4700
7+
San Francisco, CA, 94129
8+
9+
Everyone is permitted to copy and distribute verbatim copies of this
10+
license document, but changing it is not allowed.
11+
12+
13+
Developer's Certificate of Origin 1.1
14+
15+
By making a contribution to this project, I certify that:
16+
17+
(a) The contribution was created in whole or in part by me and I
18+
have the right to submit it under the open source license
19+
indicated in the file; or
20+
21+
(b) The contribution is based upon previous work that, to the best
22+
of my knowledge, is covered under an appropriate open source
23+
license and I have the right under that license to submit that
24+
work with modifications, whether created in whole or in part
25+
by me, under the same open source license (unless I am
26+
permitted to submit under a different license), as indicated
27+
in the file; or
28+
29+
(c) The contribution was provided directly to me by some other
30+
person who certified (a), (b) or (c) and I have not modified
31+
it.
32+
33+
(d) I understand and agree that this project and the contribution
34+
are public and that a record of the contribution (including all
35+
personal information I submit with it, including my sign-off) is
36+
maintained indefinitely and may be redistributed consistent with
37+
this project or the open source license(s) involved.
38+

0 commit comments

Comments
 (0)