Skip to content

Commit

Permalink
Add codespell as a linter (#1231)
Browse files Browse the repository at this point in the history
Following the example of rapidsai/cudf#12097, this PR adds [codespell](https://github.com/codespell-project/codespell) as a linter for rmm.

Note: I have not included a section in the CONTRIBUTING.md about how to use this (as was done in cudf's PR) because I plan to overhaul the contributing guides for all RAPIDS repos in the near term, and have a single source in docs.rapids.ai with common information about linters used in RAPIDS.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Rong Ou (https://github.com/rongou)
  - Ben Frederickson (https://github.com/benfred)
  - Mark Harris (https://github.com/harrism)

URL: #1231
  • Loading branch information
bdice authored Mar 14, 2023
1 parent 39f6ca5 commit 663a9b0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ repos:
(?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
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/synchronization/synchronization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
// Register the function as a benchmark. You will need to set the `UseManualTime()`
// flag in order to use the timer embeded in this class.
// flag in order to use the timer embedded in this class.
BENCHMARK(sample_cuda_benchmark)->UseManualTime();
Expand Down
2 changes: 1 addition & 1 deletion include/rmm/detail/stack_trace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
namespace rmm::detail {

/**
* @brief stack_trace is a class that will capture a stack on instatiation for output later.
* @brief stack_trace is a class that will capture a stack on instantiation for output later.
* It can then be used in an output stream to display stack information.
*
* rmm::detail::stack_trace saved_stack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct crtp {
* This base class uses CRTP (https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
* to provide static polymorphism to enable defining suballocator resources that maintain separate
* pools per stream. All of the stream-ordering logic is contained in this class, but the logic
* to determine how memory pools are managed and the type of allocation is implented in a derived
* to determine how memory pools are managed and the type of allocation is implemented in a derived
* class and in a free list class.
*
* For example, a coalescing pool memory resource uses a coalescing_free_list and maintains data
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[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"
builtin = "clear"
quiet-level = 3
2 changes: 1 addition & 1 deletion tests/device_buffer_tests.cu
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ TYPED_TEST(DeviceBufferTest, ResizeSmaller)

buff.shrink_to_fit(rmm::cuda_stream_default);
EXPECT_NE(nullptr, buff.data());
// A reallocation should have occured
// A reallocation should have occurred
EXPECT_NE(old_data, buff.data());
EXPECT_EQ(new_size, buff.size());
EXPECT_EQ(buff.capacity(), buff.size());
Expand Down
2 changes: 1 addition & 1 deletion tests/device_scalar_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ using Types = ::testing::Types<bool, int8_t, int16_t, int32_t, int64_t, float, d

TYPED_TEST_CASE(DeviceScalarTest, Types);

TYPED_TEST(DeviceScalarTest, Unitialized)
TYPED_TEST(DeviceScalarTest, Uninitialized)
{
rmm::device_scalar<TypeParam> scalar{this->stream, this->mr};
EXPECT_NE(nullptr, scalar.data());
Expand Down

0 comments on commit 663a9b0

Please sign in to comment.