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

Turn on CI for clang-tidy #10064

Closed
wants to merge 22 commits into from

Conversation

codereport
Copy link
Contributor

This is a follow up to #9860

To do list:

  • Disable clang-diagnostic-errors/warnings
  • Fix include files being skipped
  • Set up CI script
  • Clean up python script

@codereport codereport added 2 - In Progress Currently a work in progress gpuCI libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 17, 2022
@codereport codereport requested a review from a team as a code owner January 17, 2022 23:36
@codereport codereport added this to PR-WIP in v22.04 Release via automation Jan 17, 2022
@codereport codereport self-assigned this Jan 17, 2022
@github-actions github-actions bot removed the gpuCI label Jan 17, 2022
@codereport codereport marked this pull request as draft January 17, 2022 23:36
@codereport codereport mentioned this pull request Jan 17, 2022
7 tasks
@github-actions github-actions bot added the CMake CMake build issue label Jan 17, 2022
@codecov
Copy link

codecov bot commented Jan 18, 2022

Codecov Report

Merging #10064 (31e9ccc) into branch-22.04 (4596244) will decrease coverage by 0.16%.
The diff coverage is 93.70%.

@@               Coverage Diff                @@
##           branch-22.04   #10064      +/-   ##
================================================
- Coverage         86.13%   85.97%   -0.17%     
================================================
  Files               139      139              
  Lines             22438    22435       -3     
================================================
- Hits              19328    19288      -40     
- Misses             3110     3147      +37     
Impacted Files Coverage Δ
python/cudf/cudf/core/dataframe.py 93.57% <ø> (ø)
python/cudf/cudf/core/series.py 95.16% <ø> (ø)
python/dask_cudf/dask_cudf/tests/test_accessor.py 98.41% <ø> (ø)
python/cudf/cudf/core/column/decimal.py 91.30% <73.68%> (-1.01%) ⬇️
python/cudf/cudf/core/column/categorical.py 89.63% <84.61%> (-0.29%) ⬇️
python/cudf/cudf/core/column/string.py 88.91% <94.44%> (+0.64%) ⬆️
python/cudf/cudf/core/column/numerical.py 95.33% <95.83%> (+0.35%) ⬆️
python/cudf/cudf/api/types.py 89.79% <100.00%> (ø)
python/cudf/cudf/core/column/column.py 89.27% <100.00%> (+0.10%) ⬆️
python/cudf/cudf/core/column/datetime.py 88.55% <100.00%> (-0.52%) ⬇️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 621d26f...31e9ccc. Read the comment docs.

rapids-bot bot pushed a commit that referenced this pull request Jan 20, 2022
This PR is adding clang-tidy to cudf and adding the initial checks. Note more checks will be enabled in the future.

Relevant PRs:
* `rmm`: rapidsai/rmm#857
* `cuml`: rapidsai/cuml#1945

To do list:
* [x] Add `.clang-tidy` file
* [x] Add python script
* [x] Apply `modernize-` changes
* [x] Revert `cxxopts` changes
* [x] Fixed Python parquet failures
* [x] Ignore `cxxopts` file
* [x] Ignore the `build/_deps` directories

Splitting out the following into a separate PR so we can get the changes merged for 22.02 (#10064):
* ~~[ ] Disable `clang-diagnostic-errors/warnings`~~
* ~~[ ] Fix include files being skipped~~
* ~~[ ] Set up CI script~~
* ~~[ ] Clean up python script~~

Authors:
  - Conor Hoekstra (https://github.com/codereport)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)
  - David Wendt (https://github.com/davidwendt)
  - Mark Harris (https://github.com/harrism)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #9860
@codereport codereport changed the base branch from branch-22.02 to branch-22.04 January 25, 2022 16:35
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with two minor Python improvements.

@@ -86,7 +85,7 @@ def get_gpu_archs(command):
def get_index(arr, item):
try:
return arr.index(item)
except:
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arr = [1, 2, 3]
arr.index(4)  # Raises ValueError

Let's catch a more specific error:

Suggested change
except Exception:
except ValueError:

else:
out = "CMD: " + cmd
out += result.stdout.decode("utf-8").rstrip()
out = ("" if status else "CMD: " + cmd) + result.stdout.decode("utf-8").rstrip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decode/encode bytes ↔️ str uses UTF-8 by default in Python 3.

Suggested change
out = ("" if status else "CMD: " + cmd) + result.stdout.decode("utf-8").rstrip()
out = ("" if status else "CMD: " + cmd) + result.stdout.decode().rstrip()

@codereport
Copy link
Contributor Author

rerun tests

1 similar comment
@codereport
Copy link
Contributor Author

rerun tests

@codereport
Copy link
Contributor Author

rerun tests

@caryr35 caryr35 added this to PR-WIP in v22.06 Release via automation Apr 12, 2022
@caryr35 caryr35 removed this from PR-WIP in v22.04 Release Apr 12, 2022
@github-actions
Copy link

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

@codereport codereport added this to PR-WIP in v22.08 Release via automation May 25, 2022
@codereport codereport removed this from PR-WIP in v22.06 Release May 25, 2022
@codereport codereport closed this Jun 28, 2022
v22.08 Release automation moved this from PR-WIP to Done Jun 28, 2022
@vyasr vyasr mentioned this pull request May 30, 2024
3 tasks
rapids-bot bot pushed a commit that referenced this pull request Jun 12, 2024
This changeset is large, but it's not very substantial. It's all the automated fixes produced by clang-tidy using our script. The bulk of the changes are either adding `[[nodiscard]]` to many functions or changing const ref args to pass by value and then move in cases where the parameter is only used to set a value. There are also some places where clang-tidy preferred either more or less namespacing of objects depending on the current namespace. The goal is to enable clang-tidy in CI, which we made progress towards in #9860 but stalled in #10064. This PR contains the first set of changes that will required for such a check to pass.

I've marked this PR as breaking because some of the functions now marked as `[[nodiscard]]` are public APIs, so if consumers were ignoring the return values they will now see warnings, and if they are compiling with warnings as errors then the builds will break.

Contributes to #584

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)

URL: #15894
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currently a work in progress CMake CMake build issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants