Files
ROCm/.pre-commit-config.yaml
Justin Lebar df08301e76 Reformat Python code with yapf. (#2589)
I've add an option to yapf to do what we want for long lines, see
https://github.com/google/yapf/pull/1177.  We can now have a real Python
formatter, yay!

To make this PR, I ran my modified yapf over the repository, then looked
over the full diff.  Where yapf was mangling the param list of long
function decls/calls (mostly kernels), I manually added `#` to put
linebreaks where we want.  I fixed up other formatting too -- mostly
adding or removing a trailing comma from lists.

Overall, trailing `#` was sufficient to get formatting similar to our
current code.  I didn't have to disable yapf anywhere.

---------

Co-authored-by: Phil Tillet <phil@openai.com>
2023-11-02 20:44:17 -07:00

57 lines
1.4 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-symlinks
- id: destroyed-symlinks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-ast
- id: check-added-large-files
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
files: '^python/.*'
args: ["--fix", "--line-length", "120"]
stages: [commit, push, manual]
exclude: |
(?x)(
^python/triton/runtime/.*|
^test/|
^docs/conf.py$
)
- repo: https://github.com/jlebar/yapf
rev: bf301f5ef7777e137b97219842629ca78eb5ef2a
hooks:
- id: yapf
args: ["-p", "-i"]
stages: [commit, push, manual]
exclude: "python/test/unit/language/test_line_info.py"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
stages: [commit, push, manual]
exclude: |
(?x)(
^include/triton/external/|
^python/triton/third_party/
)
exclude: |
(?x)(
^include/triton/external/|
^python/triton/third_party/
)