Skip to content

Commit

Permalink
Remove redundant style check for clang-format. (#11668)
Browse files Browse the repository at this point in the history
This PR removes a redundant style check for clang-format. Our configuration in `.pre-commit-config.yaml` already runs clang-format so we don't need a separate step for that purpose in `style.sh`.

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

Approvers:
  - Ray Douglass (https://github.com/raydouglass)
  - Jordan Jacobelli (https://github.com/Ethyling)
  - Nghia Truong (https://github.com/ttnghia)

URL: #11668
  • Loading branch information
bdice authored Sep 12, 2022
1 parent dca285b commit 39ad65f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ repos:
rev: v11.1.0
hooks:
- id: clang-format
files: \.(cu|cuh|h|hpp|cpp|inl)$
types_or: [file]
args: ['-fallback-style=none', '-style=file', '-i']
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
- repo: local
hooks:
- id: no-deprecationwarning
Expand Down
20 changes: 4 additions & 16 deletions ci/checks/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}


# Run pre-commit checks
pre-commit run --hook-stage manual --all-files
PRE_COMMIT_RETVAL=$?

# Check for copyright headers in the files modified currently
COPYRIGHT=`python ci/checks/copyright.py --git-modified-only 2>&1`
CR_RETVAL=$?
COPYRIGHT_RETVAL=$?

# Output results if failure otherwise show pass
if [ "$CR_RETVAL" != "0" ]; then
if [ "$COPYRIGHT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: copyright check; begin output\n\n"
echo -e "$COPYRIGHT"
echo -e "\n\n>>>> FAILED: copyright check; end output\n\n"
Expand All @@ -37,20 +37,8 @@ else
echo -e "$COPYRIGHT"
fi

# Run clang-format and check for a consistent code format
CLANG_FORMAT=`python cpp/scripts/run-clang-format.py 2>&1`
CLANG_FORMAT_RETVAL=$?

if [ "$CLANG_FORMAT_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: clang format check; begin output\n\n"
echo -e "$CLANG_FORMAT"
echo -e "\n\n>>>> FAILED: clang format check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: clang format check\n\n"
fi

RETVALS=(
$CR_RETVAL $PRE_COMMIT_RETVAL $CLANG_FORMAT_RETVAL
$PRE_COMMIT_RETVAL $COPYRIGHT_RETVAL
)
IFS=$'\n'
RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1`
Expand Down
4 changes: 2 additions & 2 deletions cpp/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
Expand All @@ -27,7 +27,7 @@ AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/column/column_factories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ std::unique_ptr<column> make_fixed_width_column(data_type type,
else if (is_duration (type)) return make_duration_column (type, size, state, stream, mr);
else if (is_fixed_point(type)) return make_fixed_point_column(type, size, state, stream, mr);
else return make_numeric_column (type, size, state, stream, mr);
/// clang-format on
// clang-format on
}

std::unique_ptr<column> make_dictionary_from_scalar(scalar const& s,
Expand Down

0 comments on commit 39ad65f

Please sign in to comment.