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
22 changes: 15 additions & 7 deletions .pre-commit-hooks.yaml → .github/workflows/conventional-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- id: add-license
name: Add License
entry: tools/add_copyright.py
language: script
stages: [pre-commit]
verbose: true
require_serial: true
# Thin caller: the logic lives in the org-wide reusable workflow, pinned by
# tag. Workflow changes ship as a new tag in the .github repository plus a
# one-line rev bump here (tags are write-once, never moved).

name: conventional-pr

on:
pull_request:
types: [opened, edited, synchronize, reopened]

jobs:
conventional-pr:
permissions:
pull-requests: write
uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.1
15 changes: 13 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

default_install_hook_types: [pre-commit, commit-msg]

repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
Expand Down Expand Up @@ -54,6 +56,15 @@ repos:
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
# Validates commit messages against the Conventional Commits format

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: This hook only validates commit messages. It does not check pull request titles. And we don't need to add rules to the commits because everything will be squashed at the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct on both points, and that's the intended division of labor: PR titles are validated in CI by the org-wide conventional-pr reusable workflow (triton-inference-server/.github, pinned @v1.4.1) — it gates the title, since squash-merge makes the title the commit that lands on main, and it also applies the type labels. This commit-msg hook is the local fast-feedback complement so contributors catch format issues before pushing, and conforming commit subjects additionally feed the PR's multi-type labeling. If the team prefers title-only enforcement, dropping the commit-msg hook is a one-line change per repo — happy to do that in a follow-up if you'd rather not have both.

# (<commit_type>: <title>); PR titles are validated org-wide by the
# conventional-pr reusable workflow.
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]
# More details about these pre-commit hooks here:
# https://pre-commit.com/hooks.html
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -72,7 +83,7 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/triton-inference-server/developer_tools
rev: v0.1.0
- repo: https://github.com/triton-inference-server/.github
rev: v1.4.1
hooks:
- id: add-license
Loading
Loading