Skip to content

Commit

Permalink
Standardize newlines at ends of files. (#12042)
Browse files Browse the repository at this point in the history
This PR makes all files end with exactly one newline and enforces that rule with a pre-commit hook. The vast majority of files already comply with this rule, which improves consistency in the library's code style.

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

Approvers:
  - Vukasin Milovanovic (https://github.com/vuule)
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Mark Sadang (https://github.com/msadang)
  - Matthew Roeschke (https://github.com/mroeschke)
  - Robert Maynard (https://github.com/robertmaynard)
  - Nghia Truong (https://github.com/ttnghia)

URL: #12042
  • Loading branch information
bdice authored Nov 1, 2022
1 parent ac3f205 commit 03034af
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 29 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Copyright (c) 2019-2022, NVIDIA CORPORATION.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
exclude: |
(?x)^(
^python/cudf/cudf/tests/data/subword_tokenizer_data/.*
)
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion cpp/benchmarks/reduction/rank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ NVBENCH_BENCH_TYPES(nvbench_reduction_scan, NVBENCH_TYPE_AXES(data_type))
1000000, // 1M
10000000, // 10M
100000000, // 100M
});
});
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/utilities/algorithm.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ __device__ __forceinline__ T accumulate(Iterator first, Iterator last, T init, B
}
return init;
}
} // namespace cudf::detail
} // namespace cudf::detail
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/utilities/linked_column.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ inline LinkedColVector table_to_linked_columns(table_view const& table)
return LinkedColVector(linked_it, linked_it + table.num_columns());
}

} // namespace cudf::detail
} // namespace cudf::detail
4 changes: 2 additions & 2 deletions cpp/include/cudf_test/detail/column_utilities.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -82,4 +82,4 @@ std::vector<std::string> to_strings(cudf::column_view const& col, std::string co

} // namespace detail
} // namespace test
} // namespace cudf
} // namespace cudf
1 change: 0 additions & 1 deletion cpp/src/text/subword/detail/codepoint_metadata.ah
Original file line number Diff line number Diff line change
Expand Up @@ -13464,4 +13464,3 @@ uint64_t aux_cp_data_119134_119232[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,511706698612736,511706698612736,511706698731886,511706698731886,511706698731887,511706698731887
};

2 changes: 1 addition & 1 deletion cpp/tests/strings/json_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,4 +1012,4 @@ TEST_F(JsonPathTests, MissingFieldsAsNulls)
do_test("$.tup[*].array", "[[1,2],[3,4]]", "[[1,2],null,[3,4],null]");
do_test("$.x[*].array", "", "null", false);
do_test("$.tup[*].a.x", "[\"5\"]", "[null,null,null,\"5\"]");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
{%- endfor %}
{% endif %}
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
.. autoclass:: {{ objname }}
1 change: 0 additions & 1 deletion docs/cudf/source/api_docs/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ Rolling window functions
Rolling.min
Rolling.max
Rolling.apply

2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.CategoricalDtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cudf.CategoricalDtype
CategoricalDtype.categories
CategoricalDtype.ordered
CategoricalDtype.from_pandas
CategoricalDtype.to_pandas
CategoricalDtype.to_pandas
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.Decimal128Dtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ cudf.Decimal128Dtype
Decimal128Dtype.scale
Decimal128Dtype.itemsize
Decimal128Dtype.to_arrow
Decimal128Dtype.from_arrow
Decimal128Dtype.from_arrow
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.Decimal32Dtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ cudf.Decimal32Dtype
Decimal32Dtype.scale
Decimal32Dtype.itemsize
Decimal32Dtype.to_arrow
Decimal32Dtype.from_arrow
Decimal32Dtype.from_arrow
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.Decimal64Dtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ cudf.Decimal64Dtype
Decimal64Dtype.scale
Decimal64Dtype.itemsize
Decimal64Dtype.to_arrow
Decimal64Dtype.from_arrow
Decimal64Dtype.from_arrow
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.ListDtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cudf.ListDtype
ListDtype.element_type
ListDtype.leaf_type
ListDtype.from_arrow
ListDtype.to_arrow
ListDtype.to_arrow
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/cudf.StructDtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ cudf.StructDtype
StructDtype.fields
StructDtype.from_arrow
StructDtype.to_arrow
StructDtype.to_arrow
1 change: 0 additions & 1 deletion java/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ scl enable devtoolset-9 "java/ci/build-in-docker.sh"
### The output

You can find the cuDF jar in java/target/ like cudf-22.12.0-SNAPSHOT-cuda11.jar.

Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public class DeviceMemoryBufferView extends BaseDeviceMemoryBuffer {
public synchronized final DeviceMemoryBufferView slice(long offset, long len) {
throw new UnsupportedOperationException("Slice on view is not supported");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ public boolean equals(Object other) {
public int hashCode() {
return 31 * column + policy.hashCode();
}
}
}
2 changes: 1 addition & 1 deletion java/src/main/java/ai/rapids/cudf/StreamedTableReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public interface StreamedTableReader extends AutoCloseable {

@Override
void close() throws CudfException;
}
}
2 changes: 1 addition & 1 deletion java/src/main/java/ai/rapids/cudf/WindowOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,4 +328,4 @@ public void close() {
followingCol.close();
}
}
}
}
1 change: 0 additions & 1 deletion java/src/main/native/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,3 @@ Standard: Cpp11
TabWidth: 8
UseTab: Never
...

4 changes: 2 additions & 2 deletions java/src/main/native/src/dtype_utils.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,4 +62,4 @@ inline cudf::data_type make_data_type(jint out_dtype, jint scale) {
}

} // namespace jni
} // namespace cudf
} // namespace cudf
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ void testZeroSizedAllocation() {
}
assertEquals(poolSize, PinnedMemoryPool.getAvailableBytes());
}
}
}
2 changes: 1 addition & 1 deletion python/cudf/cudf/_fuzz_testing/tests/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ def set_rand_params(self, params):
else:
params_dict[param] = np.random.choice(values)
self._current_params["test_kwargs"] = self.process_kwargs(params_dict)
```
```
2 changes: 0 additions & 2 deletions python/cudf/cudf/benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ pytest --use_buffer True cudf/benchmarks/
```
pytest --dataset_dir directory_path cudf/benchmarks/
```


1 change: 0 additions & 1 deletion python/cudf_kafka/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ skip=
build
dist
__init__.py

0 comments on commit 03034af

Please sign in to comment.