Repository navigation
ci: align pre-commit hooks and GitHub templates #861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
d989a0f
97c1aec
c50ee9c
beb14df
719a778
9ad3a13
8dc0efb
46d48d7
322c8b6
e84ded5
3a98d0a
984cebe
7b5cd32
6b11879
c186c04
3bb796c
d48f793
7777c28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Copyright 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
| # are met: | ||
| # * Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # * Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # * Neither the name of NVIDIA CORPORATION nor the names of its | ||
| # contributors may be used to endorse or promote products derived | ||
| # from this software without specific prior written permission. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
| # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
| # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
| # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| # 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 | ||
| issues: write | ||
| uses: triton-inference-server/.github/.github/workflows/conventional-pr.yml@v1.4.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
|
|
@@ -24,52 +24,72 @@ | |
| # (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] | ||
|
|
||
| # The tensorrt_llm submodule is maintained in its own repository and is | ||
| # excluded from all hooks here. | ||
| exclude: ^tensorrt_llm/ | ||
| repos: | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: isort | ||
| - repo: https://github.com/Lucas-C/pre-commit-hooks.git | ||
| rev: v1.1.13 | ||
| hooks: | ||
| - id: remove-crlf | ||
| - repo: https://github.com/google/yapf | ||
| rev: v0.43.0 | ||
| hooks: | ||
| - id: yapf | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| exclude: 'tensorrt_llm/' | ||
| - id: check-merge-conflict | ||
| - id: check-symlinks | ||
| - id: detect-private-key | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: trailing-whitespace | ||
| - repo: https://github.com/PyCQA/autoflake | ||
| rev: v1.6.1 | ||
| hooks: | ||
| - id: autoflake | ||
| args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variables'] | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v16.0.0 | ||
| hooks: | ||
| - id: clang-format | ||
| types_or: [c++, c, cuda] | ||
| exclude: | | ||
| (?x)^( | ||
| tensorrt_llm/.* | ||
| )$ | ||
| - repo: https://github.com/cheshirekow/cmake-format-precommit | ||
| rev: v0.6.10 | ||
| hooks: | ||
| - id: cmake-format | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.2.4 | ||
| hooks: | ||
| - id: codespell | ||
| exclude: tools/dataset/ | ||
| args: | ||
| - --skip=".git,tensorrt_llm" | ||
| - repo: https://github.com/PyCQA/isort | ||
| rev: 5.12.0 | ||
| hooks: | ||
| - id: isort | ||
| additional_dependencies: [toml] | ||
| - repo: https://github.com/psf/black | ||
| rev: 23.1.0 | ||
| hooks: | ||
| - id: black | ||
| types_or: [python, cython] | ||
| - repo: https://github.com/PyCQA/flake8 | ||
| rev: 7.3.0 | ||
| hooks: | ||
| - id: flake8 | ||
| args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501] | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| types_or: [python, cython] | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v16.0.5 | ||
| hooks: | ||
| - id: clang-format | ||
| types_or: [c, c++, cuda, proto, textproto, java] | ||
| args: ["-fallback-style=none", "-style=file", "-i"] | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.2.4 | ||
| hooks: | ||
| - id: codespell | ||
| additional_dependencies: [tomli] | ||
| args: ["--toml", "pyproject.toml"] | ||
| exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$) | ||
| # Validates commit messages against the Conventional Commits format | ||
| # (<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 | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| - id: check-case-conflict | ||
| - id: check-executables-have-shebangs | ||
| - id: check-merge-conflict | ||
| - id: check-json | ||
| - id: check-symlinks | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: check-shebang-scripts-are-executable | ||
| - id: detect-private-key | ||
| - id: end-of-file-fixer | ||
| types_or: [c, c++, cuda, proto, textproto, java, python] | ||
| - id: mixed-line-ending | ||
| - id: requirements-txt-fixer | ||
| - id: trailing-whitespace | ||
|
|
||
| - repo: https://github.com/triton-inference-server/.github | ||
| rev: v1.4.2 | ||
| hooks: | ||
| - id: add-license | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed - documentation drift: the descriptions have been refreshed to the current pinned tag |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions | ||
| # are met: | ||
| # * Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # * Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # * Neither the name of NVIDIA CORPORATION nor the names of its | ||
| # contributors may be used to endorse or promote products derived | ||
| # from this software without specific prior written permission. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY | ||
| # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
| # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
| # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
| # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| [tool.codespell] | ||
| # note: pre-commit passes explicit lists of files here, which this skip file list doesn't override - | ||
| # this is only to allow you to run codespell interactively | ||
| skip = "./.git,./.github" | ||
| # ignore short words, and typename parameters like OffsetT | ||
| ignore-regex = "\\b(.{1,4}|[A-Z]\\w*T)\\b" | ||
| # use the 'clear' dictionary for unambiguous spelling mistakes | ||
| builtin = "clear" | ||
| # disable warnings about binary files and wrong encoding | ||
| quiet-level = 3 | ||
|
|
||
| [tool.isort] | ||
| profile = "black" | ||
| use_parentheses = true | ||
| multi_line_output = 3 | ||
| include_trailing_comma = true | ||
| force_grid_wrap = 0 | ||
| ensure_newline_before_comments = true | ||
| line_length = 88 | ||
| balanced_wrapping = true | ||
| indent = " " | ||
| skip = ["build"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--filesfor paths containing spaces.xargsconverts newlines to spaces, so--files ${{ steps.modified-files.outputs.modified_files }}is shell-word-split by the runner — any file path with a space becomes two separate (not-found) arguments. A safer approach passes the newline-separated list directly via a multi-line env variable or usesxargs -d ' 'to preserve path boundaries.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the v1.4.3 round: the workflow now uses a null-delimited pipeline (
git diff --name-only -z --diff-filter=d | xargs -0 --no-run-if-empty pre-commit run --files ...) - paths with spaces survive, deletion-only PRs skip cleanly, deleted paths are filtered, and nothing is interpolated through YAMLextra_argsanymore. pre-commit env caching is preserved via actions/cache keyed on the config hash.