Skip to content

clang-tidy: resolve bugprone-random-generator-seed#490

Merged
knoepfel merged 4 commits intomainfrom
maintenance/clang-tidy/bugprone-random-generator-seed
Apr 8, 2026
Merged

clang-tidy: resolve bugprone-random-generator-seed#490
knoepfel merged 4 commits intomainfrom
maintenance/clang-tidy/bugprone-random-generator-seed

Conversation

@greenc-FNAL
Copy link
Copy Markdown
Contributor

@greenc-FNAL greenc-FNAL commented Apr 7, 2026

Suppresses the bugprone-random-generator-seed warning on the intentional srand(std::time(nullptr)) call in test/form/writer.cpp, and tracks the fix in the April 2026 clang-tidy progress report.

Changes

  • test/form/writer.cpp: Add // NOLINT(bugprone-random-generator-seed) inline suppression; add explicit <ctime> include; use std::time(nullptr) instead of time(0).
  • docs/dev/clang-tidy-fixes-2026-04.md: New monthly report tracking outstanding clang-tidy warnings with bugprone-random-generator-seed marked as resolved ([x]).

- Use of `srand()` is intentional for predictability.
@greenc-FNAL greenc-FNAL requested review from Copilot and knoepfel April 7, 2026 22:57
@greenc-FNAL greenc-FNAL force-pushed the maintenance/clang-tidy/bugprone-random-generator-seed branch from 2c33f9f to f18755b Compare April 7, 2026 22:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a clang-tidy bugprone-random-generator-seed warning in a test by adding an in-line suppression and documenting outstanding clang-tidy items in a new monthly report.

Changes:

  • Add a NOLINT(bugprone-random-generator-seed) suppression to the srand(time(0)) call in test/form/writer.cpp.
  • Add a new developer document tracking clang-tidy warning counts for April 2026.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/form/writer.cpp Adds commentary + clang-tidy suppression for srand(time(0)).
docs/dev/clang-tidy-fixes-2026-04.md Introduces an April 2026 clang-tidy fixes tracking checklist.

Comment thread test/form/writer.cpp Outdated
Comment thread test/form/writer.cpp Outdated
Comment thread docs/dev/clang-tidy-fixes-2026-04.md
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main     #490      +/-   ##
==========================================
- Coverage   85.58%   85.47%   -0.12%     
==========================================
  Files         142      142              
  Lines        3586     3586              
  Branches      615      615              
==========================================
- Hits         3069     3065       -4     
  Misses        311      311              
- Partials      206      210       +4     
Flag Coverage Δ
unittests 85.47% <ø> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greenc-FNAL greenc-FNAL changed the title Resolve bugprone-random-generator-seed clang-tidy warning clang-tidy: resolve bugprone-random-generator-seed Apr 8, 2026
@knoepfel knoepfel merged commit 44fb935 into main Apr 8, 2026
37 checks passed
@knoepfel knoepfel deleted the maintenance/clang-tidy/bugprone-random-generator-seed branch April 8, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants