Skip to content

Commit c49e942

Browse files
authored
documentation updates (#571)
1 parent a2d3f40 commit c49e942

15 files changed

+1227
-82
lines changed

.gitmessage

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# <type>(<scope>): <short summary>
2+
# No line more than 80 chars. #### 80 chars is here: #
3+
4+
# Body: Explain *what* and *why* (not *how*).
5+
# <put body here>
6+
7+
# Conventional Footer: required if this is a breaking change
8+
# BREAKING CHANGE: <summary of what breaks>
9+
#
10+
# <Breaking change description + migration instructions>
11+
12+
# At the end: Include Co-authored-by if relevant.
13+
# Co-authored-by: name <user@users.noreply.github.com>
14+
15+
# common title types:
16+
# build: build system
17+
# ci: continous integration
18+
# docs: improves documentation
19+
# feat: adds a new feature
20+
# fix: fixes a code bug
21+
# perf: performance improvement
22+
# refactor: changes code, neither a fix nor feature
23+
# revert: reverts a prior commit(s)
24+
# style: style update
25+
26+
# common title scopes:
27+
# data: Database information
28+
# schema: Database schema
29+
# ruby: Ruby code

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,63 @@ repos:
88
rev: v5.0.0
99
hooks:
1010
- id: check-ast
11+
stages: [pre-commit]
1112
- id: check-builtin-literals
13+
stages: [pre-commit]
1214
- id: check-case-conflict
15+
stages: [pre-commit]
1316
- id: check-docstring-first
17+
stages: [pre-commit]
1418
- id: check-symlinks
19+
stages: [pre-commit]
1520
- id: end-of-file-fixer
21+
stages: [pre-commit]
1622
- id: trailing-whitespace
23+
stages: [pre-commit]
1724
args: [--markdown-linebreak-ext=md]
1825
- id: check-merge-conflict
26+
stages: [pre-commit]
1927
args: ["--assume-in-merge"]
2028
exclude: \.adoc$ # sections titles Level 6 "=======" get flagged otherwise
2129
- id: check-json
30+
stages: [pre-commit]
2231
exclude: ^\.devcontainer/ # Uses JSONC (comments)
2332
- id: check-yaml
33+
stages: [pre-commit]
2434

2535
- repo: https://github.com/rbubley/mirrors-prettier
2636
rev: v3.5.3
2737
hooks:
2838
- id: prettier
39+
stages: [pre-commit]
2940
files: \.(json|toml|yml|yaml)$
3041
exclude: schemas/json-schema-draft-07.json
3142

3243
- repo: https://github.com/python-jsonschema/check-jsonschema
3344
rev: 0.33.0
3445
hooks:
3546
- id: check-jsonschema
47+
stages: [pre-commit]
3648
alias: check-jsonschema-inst
3749
files: ^arch/inst/.*\.(yaml|yml)$
3850
args: ["--schemafile", "schemas/inst_schema.json"]
3951
- id: check-jsonschema
52+
stages: [pre-commit]
4053
alias: check-jsonschema-csr
4154
files: ^arch/csr/.*\.(yaml|yml)$
4255
args: ["--schemafile", "schemas/csr_schema.json"]
4356
- id: check-jsonschema
57+
stages: [pre-commit]
4458
alias: check-jsonschema-ext
4559
files: ^arch/ext/.*\.(yaml|yml)$
4660
args: ["--schemafile", "schemas/ext_schema.json"]
4761
- id: check-jsonschema
62+
stages: [pre-commit]
4863
alias: check-jsonschema-cert-model
4964
files: ^arch/proc_cert_model/.*\.(yaml|yml)$
5065
args: ["--schemafile", "schemas/proc_cert_model_schema.json"]
5166
- id: check-jsonschema
67+
stages: [pre-commit]
5268
alias: check-jsonschema-cert-class
5369
files: ^arch/proc_cert_class/.*\.(yaml|yml)$
5470
args: ["--schemafile", "schemas/proc_cert_class_schema.json"]
@@ -62,6 +78,7 @@ repos:
6278
rev: "v20.1.0"
6379
hooks:
6480
- id: clang-format
81+
stages: [pre-commit]
6582
types_or: [c++, c]
6683
files: \.(hpp|cpp)$
6784
# TEMPORARILY DISABLE CLANG-FORMAT IN LIBHART
@@ -71,11 +88,13 @@ repos:
7188
rev: 25.1.0
7289
hooks:
7390
- id: black
91+
stages: [pre-commit]
7492

7593
- repo: https://github.com/asottile/pyupgrade
7694
rev: v3.19.1
7795
hooks:
7896
- id: pyupgrade
97+
stages: [pre-commit]
7998

8099
- repo: local
81100
hooks:
@@ -90,6 +109,7 @@ repos:
90109
rev: v3.11.0-1
91110
hooks:
92111
- id: shfmt
112+
stages: [pre-commit]
93113
args:
94114
- --indent
95115
- "2"
@@ -99,3 +119,11 @@ repos:
99119
rev: v5.0.2
100120
hooks:
101121
- id: reuse
122+
123+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
124+
rev: v9.22.0
125+
hooks:
126+
- id: commitlint
127+
stages: [commit-msg]
128+
additional_dependencies:
129+
- "@commitlint/config-conventional"

CODE_OF_CONDUCT.adoc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
= UnifiedDB Code of Conduct
2+
3+
UnifiedDB follows the RISC-V International Code of Conduct.
4+
5+
== Our Pledge
6+
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, sex characteristics, gender identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
7+
8+
== Our Standards
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+
Examples of unacceptable behavior by participants include:
17+
18+
The use of sexualized language or imagery and unwelcome sexual attention or advances
19+
Trolling, insulting/derogatory comments, and personal or political attacks
20+
Trafficking in disinformation, unsubstantiated slanderous rumors, and conspiracy theories
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+
Our Responsibilities
25+
RISC-V International is responsible for clarifying the standards of acceptable behavior and is expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. RISC-V International has 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.
26+
27+
== Scope
28+
This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. 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.
29+
30+
== Enforcement
31+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting RISC-V International at conduct@riscv.org. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. RISC-V International is obligated to maintain confidentiality with regard to the reporter of an incident.
32+
33+
== Enforcement Guidelines
34+
RISC-V International will follow these guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
35+
36+
=== 1. Correction
37+
Community Impact:: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
38+
39+
Consequence:: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. Moderation of postings may be used if applicable.
40+
41+
=== 2. Warning
42+
Community Impact:: A violation through a single incident or series of actions.
43+
44+
Consequence:: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
45+
46+
=== 3. Temporary Ban
47+
Community Impact:: A serious violation of community standards, including sustained inappropriate behavior.
48+
49+
Consequence:: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
50+
51+
=== 4. Permanent Ban
52+
Community Impact:: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
53+
54+
Consequence:: A permanent ban from any sort of public interaction within the community.
55+
56+
== Attribution
57+
This Code of Conduct is based on the https://www.contributor-covenant.org/version/2/1/code_of_conduct/[Contributor Covenant, version 2.1]. For answers to common questions about this code of conduct, see the Contributor Covenant https://www.contributor-covenant.org/faq[FAQ].

CONTRIBUTING.adoc

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
= UnifiedDB Contribution Guide
2+
3+
Thank you for your interest in contributing to UnifiedDB!
4+
We welcome all contributions that meet our xref:CODE_OF_CONDUCT.adoc[code of conduct].
5+
6+
== Ways to contribute
7+
8+
=== Bug Reports
9+
10+
Bug reports should be filed as a https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] using the `Bug report` template.
11+
12+
=== Feature Requests
13+
14+
Bug reports should be filed as a https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] using the `Feature request` template.
15+
16+
=== Bug Fixes
17+
18+
Bug fixes should be submitted as a Pull Request.
19+
20+
There should be a corresponding https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] for the PR. Ensure the two are linked by adding "closes #<issue number>" in the PR description.
21+
22+
=== New data, tools, and features
23+
24+
New data (for example, adding an extension), tools, or features should be submitted as a Pull Request.
25+
26+
There should be a corresponding https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] for the PR. Ensure the two are linked by adding "closes #<issue number>" in the PR description.
27+
28+
== Submitting a Pull Request
29+
30+
All patches must meet the UnifiedDB code standards. This includes:
31+
32+
* Pass regression tests (run locally as `./do test:regress`)
33+
* Use appropriate commit messages
34+
* Go through code review as a Pull Request
35+
36+
=== Regression tests
37+
38+
All contributions must pass the full suite of regression tests.
39+
Regression tests are checked in GitHub for every PR, and they can also be run locally using `./do test:regress`.
40+
41+
If a Pull Request adds a new feature that is not already covered by the regression test suite, it
42+
must add at least one new test.
43+
44+
=== Commit messages
45+
46+
UnifiedDB adheres to https://www.conventionalcommits.org/en/v1.0.0[Conventional Commits v1.0.0].
47+
48+
The guidelines below are adapted from https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md[the Angular commit message guidelines].
49+
50+
Every commit message consists of a mandatory *header*, a mandatory *body*, and an optional *footer*.
51+
52+
```
53+
<header>
54+
<BLANK LINE>
55+
<body>
56+
<BLANK LINE>
57+
<footer>
58+
```
59+
60+
A template for commit messages is stored in xref:.gitmessage[], and will be installed automatically through the standard UnifiedDB setup script so that it appears when executing `git commit`.
61+
62+
==== Header
63+
64+
.UnifiedDB commit header format
65+
```
66+
<type>(<scope>): <short summary>
67+
│ │ │
68+
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
69+
│ │
70+
│ └─⫸ Optional Commit Scope: single word describing the component
71+
72+
└─⫸ Commit Type: e.g., build|ci|docs|feat|fix|perf|refactor|revert|style|test
73+
```
74+
75+
The `<type>` and `<summary>` fields are mandatory. The `<scope>` field is optional.
76+
77+
==== Body
78+
79+
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
80+
81+
Explain the motivation for the change in the commit message body. This commit message should explain
82+
_why_ you are making the change.
83+
You can include a comparison of the previous behavior with the new behavior in order to illustrate
84+
the impact of the change.
85+
86+
==== Footer
87+
88+
A footer is required when the commit introduces a breaking change, closes a GitHub issue,
89+
or has relevant git trailers.
90+
91+
===== Breaking change
92+
93+
When a commit introduces a breaking change to _any_ component, the commit message *must* include
94+
a breaking change note in the footer:
95+
96+
```
97+
BREAKING CHANGE: <breaking change summary>
98+
<BLANK LINE>
99+
<breaking change description + migration instructions>
100+
```
101+
102+
==== Linked Issues and PRs
103+
104+
When a commit will close a GitHub Issue, it should be noted in the footer:
105+
106+
```
107+
Fixes #<issue number>
108+
Closes #<issue numer>
109+
```
110+
111+
==== Git trailers
112+
113+
When any of the extra information is relevant to a commit, it should be marked with a git trailer.
114+
Standard trailers for UnifiedDB include:
115+
116+
[cols="1,2,3"]
117+
|===
118+
| Key | Value format | Description
119+
| Co-authored-by | Firstname Lastname <email> | A person, other than the committer, that authored part of the patch
120+
|===
121+
122+
==== Examples
123+
124+
The following are examples of good commit messages:
125+
126+
```
127+
data(ext): add Smclic extension
128+
129+
Add metadata and IDL for Smclic (Core Local Interrupt Controller) v1.0.
130+
131+
Closes #816
132+
```
133+
134+
```
135+
correct(ext): sctrclr belongs to Smctr/Sscntr extensions
136+
137+
The sctrclr instruction was improperly `definedBy` Smdbltrp
138+
139+
Closes #490
140+
```
141+
142+
```
143+
feat(ruby-db): add Sorbet type checking
144+
145+
Add Sorbet type signatures to ruby-db code, and run Sorbet type check in CI.
146+
147+
Closes #934
148+
Co-authored-by: Frank the Tank <frank@oldschool.movie>
149+
```
150+
151+
=== Code review
152+
153+
All Pull Requests must go through the code review process.
154+
155+
All Pull Requests require approval by at least one Code Owner.
156+
157+
Code Owners are maintained in `.github/CODEOWNERS`.
158+
159+
== Finding tasks
160+
161+
If you are looking to contribute but are unsure what to do, browse through the https://github.com/riscv-software-src/riscv-unified-db/issues[issues]. We try to keep them tagged by area and mark easier tasks with "good first issue".
162+
163+
== Legal
164+
165+
All contributions to UnifiedDB are by default made under the xref:LICENSE[BSD-3-clear license].
166+
Copyrights are held by the specific contributors, and are not tracked by the UnifiedDB project other
167+
than what can be gleaned through git history.
168+
169+
Under special circumstances code may be added under a different license.
170+
For example, code from an existing project may be integrated after careful deliberation.
171+
Any contributions under a different license will receive extra review.
172+
When any contribution is made under a different license, it must be tracked using
173+
https://reuse.software/tutorial/#step-2[a Reuse-compatible identifer].
174+
175+
To keep UnifiedDB open to both private and commercial interests, contributions under a
176+
https://en.wikipedia.org/wiki/copyleft[copyleft license] will never be accepted.
177+
178+
== Maintainers
179+
180+
The current maintainers for UnifiedDB are:
181+
182+
* Derek Hower (@dhower-qc)
183+
* Paul Clarke (@ThinkOpenly)

0 commit comments

Comments
 (0)