Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ repos:
hooks:
- id: typos

# Conventional-commit message validation. Runs at commit-msg stage so the
# message format (`type(scope)!: subject` + optional body + Refs) is
# checked before the commit lands. Spec lives in docs/COMMIT_MESSAGE_STANDARD.md.
- repo: https://github.com/commitizen-tools/commitizen
rev: 4fbeae7861663ecf4b4989211eba41c1a3fb1227 # v4.13.9
hooks:
- id: commitizen
stages: [commit-msg]

# Generated README must match tests/test_readme_examples.py.
# Drift blocks commit — regenerate with `python scripts/generate_readme.py`.
# The script uses only stdlib (ast, re, textwrap), so `language: python`
Expand Down
3 changes: 1 addition & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
".": "3.0.0",
"mat-rs": "0.2.0"
".": "3.0.0"
}
18 changes: 18 additions & 0 deletions docs/COMMIT_MESSAGE_STANDARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ Only the following types are allowed:

Any other type (e.g. `feature`, `bugfix`, or emoji-based prefixes) is **not** allowed.

## Approved scopes

The `(scope)` is **optional** but recommended in this multi-package monorepo. A correctly-attributed scope makes Release PR review faster, prevents cross-cutting commits from triggering false bumps in unrelated packages (see [#50](https://github.com/MorePET/mat/issues/50), [#55](https://github.com/MorePET/mat/issues/55)), and makes the CHANGELOG self-documenting.

| Scope | Meaning | Example |
|-------|---------|---------|
| `(py)` | py-materials Python package code | `feat(py): add Material.melting_point_qty` |
| `(rs)` | rs-materials Rust crate code | `feat(rs)!: rename MaterialDb to Catalog` |
| `(data)` | TOML data files (shared between py + rs via symlinks) | `fix(data): correct stainless density to 8.0 g/cm³` |
| `(vis)` | The vis subsystem (Python-side, mat-vis-client integration) | `feat(vis): expose .mtlx() façade` |
| `(deps)` | Dependency bumps (typically from dependabot) | `build(deps): bump mat-vis-client to 0.5.0` |
| `(ci)` | CI workflows, release pipeline, automation | `ci: gate crates.io publish on repo var` |
| `(docs)` | Documentation only | `docs(migration): add v3-to-v4 stub` |

**No scope** is acceptable for cross-cutting work that genuinely touches multiple packages — but **prefer splitting into per-scope commits** when possible. Squash-merging a multi-scope PR collapses these distinctions and can mislead release tooling (the rationale documented in [issue #50](https://github.com/MorePET/mat/issues/50)).

Scopes are validated for *format* (alphanumeric + hyphens) by the commit-msg hook (commitizen), not for *membership* in the table above — the table is a strong convention enforced socially via review.

## Refs line and traceability

The `Refs:` line provides mandatory traceability to issues, requirements, risks, or SOPs. Only one `Refs:` line is allowed; it must be the last non-empty line of the message.
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "W", "I"]

# Commitizen — conventional-commit message validation at commit-msg stage
# (configured via .pre-commit-config.yaml). Using the default
# `cz_conventional_commits` rule set; the project's allowed types and the
# scope taxonomy are documented in docs/COMMIT_MESSAGE_STANDARD.md and
# enforced socially via review (commitizen permits any scope by default).
[tool.commitizen]
name = "cz_conventional_commits"
version = "3.0.0"
tag_format = "v$version"
update_changelog_on_bump = false

[dependency-groups]
dev = [
"ruff>=0.15.10",
Expand Down
7 changes: 0 additions & 7 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
"path": "src/pymat/__init__.py"
}
]
},
"mat-rs": {
"release-type": "rust",
"package-name": "rs-materials",
"component": "rs-materials",
"include-component-in-tag": true,
"tag-separator": "/"
}
}
}
Loading