Commit Graph

7 Commits

Author SHA1 Message Date
Claude
871e7e54cf feat(tidy): add fairmq-modernize-run-device
- Migrate a device main file from <runFairMQDevice.h> to
  <fairmq/runDevice.h>: the include, the FairMQDevicePtr return type,
  the const ProgOptions& parameter and 'return new T(...)', which becomes
  'return std::make_unique<T>(...)'.
- Fix all of it or nothing: if a return statement of getDevice() is not
  a plain new expression, only report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:28:29 +00:00
Claude
67fd7f2305 feat(tidy): add fairmq-modernize-progoptions-accessors
- Replace GetValue<T>(key) with GetProperty<T>(key, {}) and
  GetStringValue(key) with GetPropertyAsString(key, {}). The {} default
  keeps the old result for an unknown key, where the property API throws.
- Replace SetValue() with SetProperty() only where its always-zero
  result is unused, because SetProperty() returns void.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:28:29 +00:00
Claude
83d0e741f5 feat(tidy): add fairmq-modernize-parts-api
- Replace Parts::AtRef(i) with Parts::At(i). At() returns a reference
  to the MessagePtr, so a following '.' becomes '->', and a lone call
  gets a leading '*'.
- Wrap the raw pointer of Parts::AddPart(Message*) in
  fair::mq::MessagePtr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:28:29 +00:00
Claude
3975017183 feat(tidy): add fairmq-modernize-deprecated-functions
- Replace Device::GetStateName() and Device::GetTransitionName() with
  the free functions fair::mq::GetStateName() and GetTransitionName().
- Replace Socket::GetConstant() of the zeromq and shmem transports with
  fair::mq::zmq::getConstant() and include <fairmq/zeromq/Common.h>.
- Report Socket::Close() without a fix: the socket closes when it is
  destroyed, so the call must go away, not be renamed.
- Skip the fix if the object expression has side effects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:28:23 +00:00
Claude
84ac7aecfd feat(tidy): add fairmq-modernize-channels-access
- Report uses of the deprecated member fair::mq::Device::fChannels.
- Replace fChannels.at(name).at(index) with GetChannel(name, index) and
  every other use with GetChannels().
- Ignore uses inside fair::mq::Device itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:23:27 +00:00
Claude
d4a3c06c7b feat(tidy): add fairmq-modernize-deprecated-headers
- Report includes of the ten deprecated headers, e.g. <FairMQDevice.h>
  or <fairmq/FairMQDevice.h>, and replace them with the successor, e.g.
  <fairmq/Device.h>. Today these headers only emit a #pragma warning.
- Keep the quote style of the include.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:23:27 +00:00
Claude
cbcd0d3324 refactor(tidy)!: rebuild fairmq-tidy on top of clang-tidy
- Implement the checks as a clang-tidy module (object library
  fairmq-tidy-module) instead of a standalone LibTooling program.
- Build fairmq-tidy from clangTidyMain plus the module. It gets all
  clang-tidy features: --fix, --export-fixes, .clang-tidy files, NOLINT,
  header filter, and the upstream checks on the same parse.
- Without a --checks option, add fairmq-* to the configured checks.
- Point the driver to the resource directory of the LLVM installation it
  was built with, so it finds the Clang builtin headers from any install
  location. The -I hint in fairmq_target_tidy() is no longer necessary.
- Add the include directories of LLVM and Clang. The old target compiled
  only where they are in /usr/include.
- Port fairmq-modernize-nonnamespaced-types. Match deprecated global
  aliases into fair::mq instead of the name prefix "FairMQ": this also
  finds e.g. InputMsgCallback and skips aliases that are not deprecated.
  Match only the TypedefTypeLoc, so each use is reported once.

BREAKING CHANGE: fairmq-tidy takes the options of clang-tidy and reads
.clang-tidy files. With no .clang-tidy file it now also runs the default
clang-tidy checks (clang-diagnostic-*, clang-analyzer-*).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 09:23:27 +00:00