Skip to content

Replace commented-out parameter names with [[maybe_unused]] attribute #159

@coderabbitai

Description

@coderabbitai

Description

Currently, the codebase uses commented-out parameter names (e.g., /*context*/) to indicate unused parameters. This should be replaced with the standard C++17 [[maybe_unused]] attribute for better code clarity and consistency.

Current Pattern

auto sleep_test(spider::TaskContext& /*context*/, int milliseconds) -> int {
    std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
    return milliseconds;
}

Proposed Pattern

auto sleep_test([[maybe_unused]] spider::TaskContext& context, int milliseconds) -> int {
    std::this_thread::sleep_for(std::chrono::milliseconds{milliseconds});
    return milliseconds;
}

Benefits

  • Uses standard C++17 attribute instead of comments
  • Clearer intent and better compiler support
  • Consistent with modern C++ practices
  • Maintains parameter names for documentation purposes

Scope

Based on initial analysis, this pattern appears throughout the codebase in various test files and implementation files.

References

cc: @sitaowang1998

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions