Skip to content
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

Add configuration for pre-commit.ci, update pre-commit hooks #1746

Merged
merged 7 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
186 changes: 98 additions & 88 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,91 +1,101 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
ci:
autofix_commit_msg: |
[pre-commit.ci] auto code formatting
autofix_prs: false
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: quarterly
skip: []
submodules: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--settings-path=python/rmm/pyproject.toml"]
files: python/.*
types_or: [python, cython, pyi]
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
args: ["--config=python/rmm/pyproject.toml"]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.15.0
hooks:
- id: cython-lint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: https://github.com/sirosen/texthooks
rev: 0.4.0
hooks:
- id: fix-smartquotes
exclude: |
(?x)^(
^benchmarks/utilities/cxxopts.hpp
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
exclude: |
(?x)^(
pyproject.toml|
benchmarks/utilities/cxxopts.hpp
)
- repo: local
hooks:
- id: cmake-format
name: cmake-format
entry: ./scripts/run-cmake-format.sh cmake-format
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- id: cmake-lint
name: cmake-lint
entry: ./scripts/run-cmake-format.sh cmake-lint
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- id: doxygen-check
name: doxygen-check
entry: ./scripts/doxygen.sh
types_or: [file]
language: system
pass_filenames: false
verbose: true
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
hooks:
- id: ruff
files: python/.*$
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.4.0
hooks:
- id: verify-copyright
- id: verify-alpha-spec
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--settings-path=python/rmm/pyproject.toml"]
files: python/.*
types_or: [python, cython, pyi]
- repo: https://github.com/ambv/black
rev: 24.10.0
hooks:
- id: black
args: ["--config=python/rmm/pyproject.toml"]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.6
hooks:
- id: cython-lint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: https://github.com/sirosen/texthooks
rev: 0.6.8
hooks:
- id: fix-smartquotes
exclude: |
(?x)^(
^benchmarks/utilities/cxxopts.hpp
)
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
exclude: |
(?x)^(
pyproject.toml|
benchmarks/utilities/cxxopts.hpp
)
- repo: local
hooks:
- id: cmake-format
name: cmake-format
entry: ./scripts/run-cmake-format.sh cmake-format
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- id: cmake-lint
name: cmake-lint
entry: ./scripts/run-cmake-format.sh cmake-lint
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- id: doxygen-check
name: doxygen-check
entry: ./scripts/doxygen.sh
types_or: [file]
language: system
pass_filenames: false
verbose: true
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
files: python/.*$
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v0.4.0
hooks:
- id: verify-copyright
- id: verify-alpha-spec
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]

default_language_version:
python: python3
python: python3
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

[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 = "./pyproject.toml,./.git,./.github,./cpp/build,.*egg-info.*,./.mypy_cache,./benchmarks/utilities/cxxopts.hpp"
# ignore short words, and typename parameters like OffsetT
ignore-regex = "\\b(.{1,4}|[A-Z]\\w*T)\\b"
ignore-words-list = "inout"
ignore-words-list = "inout,thirdparty"
builtin = "clear"
quiet-level = 3

Expand Down
2 changes: 1 addition & 1 deletion python/rmm/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def on_missing_reference(app, env, node, contnode):
# all that's missing. Include the empty prefix in case we're searching
# for a stripped template.
extra_prefixes = ["rmm::", "rmm::mr::", "mr::", ""]
for (name, dispname, typ, docname, anchor, priority) in env.domains[
for name, dispname, typ, docname, anchor, priority in env.domains[
"cpp"
].get_objects():
for prefix in extra_prefixes:
Expand Down
Loading