Skip to content

Commit 0e54caf

Browse files
committed
feat(types): add repository best practices
Add standard open-source files: CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md, cliff.toml, .gitattributes, .editorconfig, .clippy.toml, CODEOWNERS, PR template, and issue templates.
1 parent 063d970 commit 0e54caf

13 files changed

Lines changed: 635 additions & 0 deletions

.clippy.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Clippy configuration file
2+
# See: https://doc.rust-lang.org/clippy/configuration.html
3+
4+
msrv = "1.85"
5+
cognitive-complexity-threshold = 30
6+
too-many-arguments-threshold = 8
7+
type-complexity-threshold = 250

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{toml,yml,yaml,json}]
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
max_line_length = off
17+
18+
[Makefile]
19+
indent_style = tab

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Force LF line endings everywhere — ensures cargo fmt --check passes on Windows CI.
2+
* text=auto eol=lf
3+
4+
# Binary files
5+
*.png binary
6+
*.ico binary

.github/CODEOWNERS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# oxidized-types — Code Owners
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
#
4+
# These owners are automatically requested for review when a PR touches
5+
# matching paths. Order matters — later rules override earlier ones.
6+
7+
# Default: project owner reviews everything
8+
* @dodoflix
9+
10+
# CI/CD and tooling
11+
.github/ @dodoflix
12+
deny.toml @dodoflix
13+
rust-toolchain.toml @dodoflix
14+
Cargo.toml @dodoflix
15+
16+
# Copilot instructions (affects all AI-assisted development)
17+
.github/copilot-instructions.md @dodoflix
18+
19+
# Source code
20+
src/ @dodoflix
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Bug Report
2+
description: Report a crash, panic, incorrect behaviour, or protocol incompatibility
3+
labels: ["bug", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report a bug!
9+
Please fill in as much detail as possible.
10+
11+
- type: input
12+
id: crate
13+
attributes:
14+
label: Affected crate
15+
description: This repository contains a single crate.
16+
value: oxidized-types
17+
validations:
18+
required: true
19+
20+
- type: input
21+
id: version
22+
attributes:
23+
label: Crate version / commit
24+
placeholder: "e.g. main@abc1234 or 0.1.0"
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: description
30+
attributes:
31+
label: What happened?
32+
description: A clear description of the bug.
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: expected
38+
attributes:
39+
label: What did you expect to happen?
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
id: reproduce
45+
attributes:
46+
label: Steps to reproduce
47+
placeholder: |
48+
1. Add oxidized-types to Cargo.toml
49+
2. Call …
50+
3. …
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
id: logs
56+
attributes:
57+
label: Relevant log output / stack trace
58+
render: text
59+
60+
- type: textarea
61+
id: environment
62+
attributes:
63+
label: Environment
64+
placeholder: |
65+
OS: Ubuntu 24.04
66+
Rust: 1.87.0

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 📖 Project
4+
url: https://github.com/oxidized-mc/types
5+
about: Project overview and status
6+
- name: 💬 Discussions
7+
url: https://github.com/oxidized-mc/types/discussions
8+
about: General questions and community chat
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Feature Request
2+
description: Suggest a new feature or improvement
3+
labels: ["enhancement", "needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for the suggestion!
9+
10+
- type: textarea
11+
id: problem
12+
attributes:
13+
label: Problem / motivation
14+
description: What problem does this solve?
15+
validations:
16+
required: true
17+
18+
- type: textarea
19+
id: solution
20+
attributes:
21+
label: Proposed solution
22+
validations:
23+
required: true
24+
25+
- type: textarea
26+
id: alternatives
27+
attributes:
28+
label: Alternatives considered
29+
30+
- type: textarea
31+
id: reference
32+
attributes:
33+
label: Reference (Java source / wiki.vg / RFC)
34+
description: Link to relevant vanilla Java class or protocol documentation.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "\U0001F4AC General / Question"
2+
description: Ask a question or start a discussion
3+
labels: ["question"]
4+
body:
5+
- type: textarea
6+
id: question
7+
attributes:
8+
label: Your question
9+
validations:
10+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Summary
2+
3+
<!-- One-sentence description of what this PR does. -->
4+
5+
## Motivation
6+
7+
<!-- Why is this change needed? Link to relevant issue(s): Closes #xxx -->
8+
9+
## Changes
10+
11+
<!-- Bullet list of what changed. -->
12+
13+
-
14+
-
15+
16+
## Reference
17+
18+
<!-- Did you check the vanilla Java reference? Paste the relevant class/method. -->
19+
20+
<details>
21+
<summary>Java reference (if applicable)</summary>
22+
23+
```java
24+
// mc-server-ref/decompiled/net/minecraft/...
25+
```
26+
27+
</details>
28+
29+
## Testing
30+
31+
<!-- How did you test this? Unit tests added? Property-based tests? -->
32+
33+
- [ ] Unit tests added / updated
34+
- [ ] `cargo test` passes
35+
- [ ] `cargo clippy --all-targets -- -D warnings` passes
36+
- [ ] `cargo fmt --check` passes
37+
38+
## Quality Checklist
39+
40+
<!-- Standard code quality checks. All must pass. -->
41+
42+
- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
43+
- [ ] Public API has documentation (`///` doc comments with `# Errors` sections)
44+
- [ ] No `unwrap()` / `expect()` in production paths (use `?` or proper error handling)
45+
- [ ] No hardcoded magic numbers — use named constants
46+
- [ ] CHANGELOG.md updated if user-visible change
47+
48+
## Architecture Compliance
49+
50+
<!-- Verify this change respects existing architecture. -->
51+
52+
- [ ] No upward imports (lower-tier crates must not depend on higher-tier)
53+
- [ ] Error handling uses `thiserror` / `?` propagation (no `unwrap` in production)
54+
55+
## Continuous Improvement
56+
57+
<!-- Every PR is an opportunity to make the project better. -->
58+
59+
- [ ] **Checked:** Could any existing patterns be improved?
60+
- [ ] **Checked:** Are there stale references (renamed items, moved files, changed APIs)?
61+
- [ ] Any identified improvements are recorded (new issue or PR)

CODE_OF_CONDUCT.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment:
18+
19+
- Demonstrating empathy and kindness toward other people
20+
- Being respectful of differing opinions, viewpoints, and experiences
21+
- Giving and gracefully accepting constructive feedback
22+
- Accepting responsibility and apologizing to those affected by our mistakes
23+
- Focusing on what is best not just for us as individuals, but for the overall community
24+
25+
Examples of unacceptable behavior:
26+
27+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
28+
- Trolling, insulting or derogatory comments, and personal or political attacks
29+
- Public or private harassment
30+
- Publishing others' private information without their explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a professional setting
32+
33+
## Enforcement Responsibilities
34+
35+
Community leaders are responsible for clarifying and enforcing our standards of
36+
acceptable behavior and will take appropriate and fair corrective action in
37+
response to any behavior that they deem inappropriate, threatening, offensive,
38+
or harmful.
39+
40+
## Scope
41+
42+
This Code of Conduct applies within all community spaces, and also applies when
43+
an individual is officially representing the community in public spaces.
44+
45+
## Enforcement
46+
47+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
48+
reported to the project maintainers. All complaints will be reviewed and
49+
investigated promptly and fairly.
50+
51+
## Attribution
52+
53+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
54+
version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
55+
56+
[homepage]: https://www.contributor-covenant.org
57+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

0 commit comments

Comments
 (0)