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>
This commit is contained in:
Claude
2026-11-09 22:57:09 +00:00
parent 83d0e741f5
commit 67fd7f2305
6 changed files with 148 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include <fairmq/tidy/DeprecatedHeadersCheck.h>
#include <fairmq/tidy/NonNamespacedTypesCheck.h>
#include <fairmq/tidy/PartsApiCheck.h>
#include <fairmq/tidy/ProgOptionsAccessorsCheck.h>
#include <clang-tidy/ClangTidyModule.h>
#include <clang-tidy/ClangTidyModuleRegistry.h>
@@ -29,6 +30,7 @@ class Module : public clang::tidy::ClangTidyModule
factories.registerCheck<DeprecatedHeadersCheck>("fairmq-modernize-deprecated-headers");
factories.registerCheck<NonNamespacedTypesCheck>("fairmq-modernize-nonnamespaced-types");
factories.registerCheck<PartsApiCheck>("fairmq-modernize-parts-api");
factories.registerCheck<ProgOptionsAccessorsCheck>("fairmq-modernize-progoptions-accessors");
}
};