Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
105 lines (95 loc) · 4.82 KB
/
Copy path.coderabbit.yaml
File metadata and controls
105 lines (95 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
reviews:
profile: chill
high_level_summary: true
high_level_summary_in_walkthrough: true
poem: false
auto_review:
enabled: true
drafts: false
base_branches:
- "^main$"
ignore_usernames: ["rapids-bot", "GPUtester", "nv-automation-bot", "copy-pr-bot"]
tools:
gitleaks:
enabled: true
markdownlint:
enabled: true
shellcheck:
enabled: true
sequence_diagrams: false
collapse_walkthrough: true
# Reduce noise from status messages
request_changes_workflow: false
review_status: false
pre_merge_checks:
docstrings:
mode: "off"
# Path-specific review instructions
path_instructions:
- path: "src/rapids_pre_commit_hooks/**"
instructions: |
These Python modules are linters that enforce various code and
configuration conventions specific to RAPIDS projects. These linters
should never modify any files directly. Instead, they should use
`rapids_pre_commit_hooks.lint.LintMain` to do the work of processing
lists of files. Each file will have a corresponding
`rapids_pre_commit_hooks.lint.Linter` instance, to which the linters
can add warnings, notes, and replacements. Warnings prevent changes
from being merged into the project, and replacements are automatically
applied. Therefore, warnings should only be issued for genuinely
incorrect code, and replacements should only be issued if there is no
ambiguity about what the correct fix is.
- path: "src/rapids_pre_commit_hooks/dependencies/**"
instructions: |
These modules are part of the `verify-dependencies` check. Each module
has a `rapids_pre_commit_hooks.utils.dependencies_yaml.Handler` class,
which handles the recursive descent into a `dependencies.yaml` file.
A JSON schema for `dependencies.yaml` can be found at
https://github.com/rapidsai/dependency-file-generator/blob/main/src/rapids_dependency_file_generator/schema.json.
The handler should be registered in
`rapids_pre_commit_hooks.dependencies.check_dependencies()`. Because
`verify-dependencies` has multiple handlers, these handlers should take
care to not issue replacements that might overlap with each other.
- path: "tests/rapids_pre_commit_hooks/**"
instructions: |
These are unit tests and integration tests for the linters in the
`rapids_pre_commit_hooks` module. They should thoroughly test all the
functionality of their corresponding hook, ensuring that the warnings,
notes, and replacements all have the expected spans, messages, and
replacement text. These tests should never hard-code the spans, but
should instead use
`rapids_pre_commit_hooks_test_utils.parse_named_spans()`, which
provides a DSL for easily extracting spans from a string. A full
description of this DSL can be found in the docstring for
`parse_named_spans()`. Tests for YAML-based hooks should generally use
`rapids_pre_commit_hooks_test_utils.find_yaml_node_for_span()` rather
than hard-coding a path to the desired YAML node, though some very
small and trivial tests may use the nodes directly.
- path: "tests/examples/**"
instructions: |
These are simple smoke tests that only ensure that each hook is
packaged correctly by actually running `pre-commit` with the hook.
They are not meant to thoroughly test the functionality of the hook.
For each hook in `.pre-commit-hooks.yaml`, there must be a subdirectory
in this directory with the same name containing a `pass` subdirectory
and a `fail` subdirectory. Details of how these tests should be laid
out can be found in the implementation of `tests/test_pre_commit.py`.
- path: "tests/utils/rapids_pre_commit_hooks_test_utils.py"
instructions: |
This file contains common functionality for the hook tests. Functions
that are used by multiple tests across multiple files should be placed
here. In particular, this is where `parse_named_spans()` is located,
which is critical for tests to show where warnings, notes, and
replacements should be placed. `parse_named_spans()` specifies a DSL
for specifying these spans.
- path: "tests/test_testing_utils.py"
instructions: |
This file is meant to test the functionality of
`rapids_pre_commit_hooks_testing_utils`, such as `parse_named_spans()`.
Because it is testing the functionality of the testing infrastructure
itself, this is the only place where it is acceptable to hard-code the
values of spans.
knowledge_base:
opt_out: false