Skip to content

refactor: Update yscope-dev-utils and apply latest clang-format settings. - #96

Merged
sitaowang1998 merged 7 commits into
y-scope:mainfrom
sitaowang1998:dev-utils
Apr 5, 2025
Merged

refactor: Update yscope-dev-utils and apply latest clang-format settings.#96
sitaowang1998 merged 7 commits into
y-scope:mainfrom
sitaowang1998:dev-utils

Conversation

@sitaowang1998

@sitaowang1998 sitaowang1998 commented Apr 4, 2025

Copy link
Copy Markdown
Collaborator

Description

This pr updates yscope-dev-utils dependency to d22183ffa3fb95745b012eb38a6e13b7e5f06fca. The new version of yscope-dev-utils introduces new clang-format rules, so we reformat the source files accordingly. This pr also uses the new clang-format task provided by yscope-dev-utils.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • GitHub workflows pass
  • clang-format-check pass in dev container

Summary by CodeRabbit

  • Chores
    • Upgraded the clang-format tool to version >=20.1.0 for improved code formatting.
    • Updated file paths and task definitions in configuration files for better maintainability.
  • Style / Refactor
    • Applied extensive formatting refinements across the codebase to enhance code consistency and readability.
  • Tests
    • Adjusted testing environment settings and task dependencies to ensure smoother automated validations.

@sitaowang1998
sitaowang1998 requested a review from a team as a code owner April 4, 2025 16:52
@coderabbitai

coderabbitai Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request updates several linting configurations by modifying dependency versions and consolidating task commands. The lint-requirements.txt file now specifies a newer version of clang-format and removes an outdated comment. The lint-tasks.yaml (along with related task files) has been reorganised to update file paths, extend source file patterns, and rename tasks to a more consistent naming convention. In addition, many source and test files have undergone cosmetic formatting adjustments such as removal of extraneous blank lines and reformatting of method signatures. A subproject commit hash was also updated.

Changes

File(s) Change Summary
lint-requirements.txt Removed an outdated comment and updated the clang-format version constraint from ~=18.1 to >=20.1.0.
lint-tasks.yaml, taskfile.yaml, test-tasks.yaml Updated file paths, source patterns, and task names (e.g. consolidated clang-format tasks and renamed venv/checksum tasks) to improve consistency and organisation.
src/spider/... Numerous source files underwent cosmetic adjustments: removal of blank lines, reformatting of method signatures, and alignment enhancements without functional changes.
tests/... Minor formatting changes, primarily the removal of unnecessary blank lines in various test files.
tools/yscope-dev-utils Updated subproject commit hash to the latest commit, reflecting an update in the external utility repository.

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f805e59 and 7e75025.

📒 Files selected for processing (1)
  • test-tasks.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test-tasks.yaml
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: non-storage-unit-tests (ubuntu-24.04)
  • GitHub Check: non-storage-unit-tests (ubuntu-22.04)
  • GitHub Check: lint

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sitaowang1998
sitaowang1998 requested a review from davidlion April 4, 2025 16:53

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
lint-requirements.txt (1)

2-3: Dependency Version Update and Comment Consistency Check
The clang-format dependency is now specified as >=20.1.0, which supports the updated formatting rules. However, the comment on line 3 still indicates a lock to v19.x. Please update or remove this comment to avoid any confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d67fd83 and f805e59.

📒 Files selected for processing (73)
  • lint-requirements.txt (1 hunks)
  • lint-tasks.yaml (5 hunks)
  • src/spider/client/Data.hpp (0 hunks)
  • src/spider/client/Driver.cpp (0 hunks)
  • src/spider/client/Driver.hpp (2 hunks)
  • src/spider/client/Job.hpp (3 hunks)
  • src/spider/client/TaskContext.cpp (0 hunks)
  • src/spider/client/TaskContext.hpp (2 hunks)
  • src/spider/client/task.hpp (0 hunks)
  • src/spider/client/type_utils.hpp (0 hunks)
  • src/spider/core/Data.hpp (0 hunks)
  • src/spider/core/DataImpl.hpp (0 hunks)
  • src/spider/core/Driver.hpp (0 hunks)
  • src/spider/core/Error.hpp (0 hunks)
  • src/spider/core/JobMetadata.hpp (0 hunks)
  • src/spider/core/Task.hpp (2 hunks)
  • src/spider/core/TaskContextImpl.hpp (1 hunks)
  • src/spider/core/TaskGraph.hpp (4 hunks)
  • src/spider/core/TaskGraphImpl.hpp (3 hunks)
  • src/spider/io/msgpack_message.cpp (2 hunks)
  • src/spider/io/msgpack_message.hpp (1 hunks)
  • src/spider/scheduler/FifoPolicy.cpp (2 hunks)
  • src/spider/scheduler/FifoPolicy.hpp (0 hunks)
  • src/spider/scheduler/SchedulerMessage.hpp (0 hunks)
  • src/spider/scheduler/SchedulerPolicy.hpp (1 hunks)
  • src/spider/scheduler/SchedulerServer.cpp (1 hunks)
  • src/spider/scheduler/SchedulerServer.hpp (0 hunks)
  • src/spider/scheduler/scheduler.cpp (2 hunks)
  • src/spider/storage/DataStorage.hpp (1 hunks)
  • src/spider/storage/MetadataStorage.hpp (1 hunks)
  • src/spider/storage/StorageConnection.hpp (0 hunks)
  • src/spider/storage/StorageFactory.hpp (1 hunks)
  • src/spider/storage/mysql/MySqlConnection.cpp (1 hunks)
  • src/spider/storage/mysql/MySqlConnection.hpp (1 hunks)
  • src/spider/storage/mysql/MySqlJobSubmissionBatch.cpp (0 hunks)
  • src/spider/storage/mysql/MySqlJobSubmissionBatch.hpp (0 hunks)
  • src/spider/storage/mysql/MySqlStorage.cpp (5 hunks)
  • src/spider/storage/mysql/MySqlStorage.hpp (5 hunks)
  • src/spider/storage/mysql/MySqlStorageFactory.cpp (2 hunks)
  • src/spider/storage/mysql/MySqlStorageFactory.hpp (1 hunks)
  • src/spider/utils/LruCache.hpp (0 hunks)
  • src/spider/worker/DllLoader.cpp (0 hunks)
  • src/spider/worker/DllLoader.hpp (0 hunks)
  • src/spider/worker/FunctionManager.cpp (2 hunks)
  • src/spider/worker/FunctionManager.hpp (4 hunks)
  • src/spider/worker/FunctionNameManager.cpp (0 hunks)
  • src/spider/worker/FunctionNameManager.hpp (0 hunks)
  • src/spider/worker/Process.cpp (0 hunks)
  • src/spider/worker/Process.hpp (0 hunks)
  • src/spider/worker/TaskExecutor.cpp (1 hunks)
  • src/spider/worker/TaskExecutor.hpp (0 hunks)
  • src/spider/worker/TaskExecutorMessage.hpp (0 hunks)
  • src/spider/worker/WorkerClient.cpp (1 hunks)
  • src/spider/worker/WorkerClient.hpp (1 hunks)
  • src/spider/worker/message_pipe.cpp (1 hunks)
  • src/spider/worker/message_pipe.hpp (1 hunks)
  • src/spider/worker/task_executor.cpp (0 hunks)
  • src/spider/worker/worker.cpp (7 hunks)
  • taskfile.yaml (1 hunks)
  • test-tasks.yaml (1 hunks)
  • tests/client/client-test.cpp (0 hunks)
  • tests/client/test-Driver.cpp (0 hunks)
  • tests/io/test-MsgpackMessage.cpp (0 hunks)
  • tests/scheduler/test-SchedulerServer.cpp (0 hunks)
  • tests/storage/StorageTestHelper.hpp (0 hunks)
  • tests/storage/test-DataStorage.cpp (0 hunks)
  • tests/storage/test-MetadataStorage.cpp (2 hunks)
  • tests/utils/CoreDataUtils.hpp (0 hunks)
  • tests/utils/CoreTaskUtils.cpp (0 hunks)
  • tests/utils/CoreTaskUtils.hpp (0 hunks)
  • tests/worker/test-Process.cpp (0 hunks)
  • tests/worker/test-TaskExecutor.cpp (1 hunks)
  • tools/yscope-dev-utils (1 hunks)
💤 Files with no reviewable changes (36)
  • src/spider/worker/DllLoader.hpp
  • src/spider/worker/Process.hpp
  • src/spider/client/task.hpp
  • src/spider/core/Error.hpp
  • src/spider/scheduler/SchedulerServer.hpp
  • src/spider/scheduler/SchedulerMessage.hpp
  • src/spider/worker/task_executor.cpp
  • src/spider/storage/mysql/MySqlJobSubmissionBatch.hpp
  • src/spider/worker/DllLoader.cpp
  • src/spider/worker/FunctionNameManager.cpp
  • tests/utils/CoreTaskUtils.hpp
  • tests/utils/CoreDataUtils.hpp
  • src/spider/worker/TaskExecutor.hpp
  • src/spider/core/DataImpl.hpp
  • src/spider/scheduler/FifoPolicy.hpp
  • tests/client/test-Driver.cpp
  • src/spider/client/type_utils.hpp
  • src/spider/core/Data.hpp
  • src/spider/core/JobMetadata.hpp
  • src/spider/client/TaskContext.cpp
  • src/spider/worker/FunctionNameManager.hpp
  • src/spider/worker/TaskExecutorMessage.hpp
  • src/spider/utils/LruCache.hpp
  • src/spider/client/Driver.cpp
  • src/spider/storage/StorageConnection.hpp
  • tests/scheduler/test-SchedulerServer.cpp
  • tests/utils/CoreTaskUtils.cpp
  • src/spider/client/Data.hpp
  • tests/worker/test-Process.cpp
  • src/spider/core/Driver.hpp
  • src/spider/storage/mysql/MySqlJobSubmissionBatch.cpp
  • src/spider/worker/Process.cpp
  • tests/io/test-MsgpackMessage.cpp
  • tests/storage/test-DataStorage.cpp
  • tests/client/client-test.cpp
  • tests/storage/StorageTestHelper.hpp
🧰 Additional context used
🧬 Code Definitions (6)
src/spider/scheduler/scheduler.cpp (1)
src/spider/storage/MetadataStorage.hpp (16)
  • conn (27-27)
  • conn (29-29)
  • conn (30-30)
  • conn (32-33)
  • conn (37-40)
  • conn (42-48)
  • conn (50-51)
  • conn (53-54)
  • conn (56-57)
  • conn (59-63)
  • conn (66-67)
  • conn (69-73)
  • conn (75-75)
  • conn (76-76)
  • conn (77-78)
  • conn (80-80)
src/spider/storage/mysql/MySqlConnection.cpp (1)
src/spider/storage/mysql/MySqlConnection.hpp (1)
  • url (34-35)
src/spider/worker/WorkerClient.cpp (1)
src/spider/worker/WorkerClient.hpp (1)
  • fail_task_id (34-35)
src/spider/storage/DataStorage.hpp (1)
src/spider/storage/MetadataStorage.hpp (16)
  • conn (27-27)
  • conn (29-29)
  • conn (30-30)
  • conn (32-33)
  • conn (37-40)
  • conn (42-48)
  • conn (50-51)
  • conn (53-54)
  • conn (56-57)
  • conn (59-63)
  • conn (66-67)
  • conn (69-73)
  • conn (75-75)
  • conn (76-76)
  • conn (77-78)
  • conn (80-80)
src/spider/core/Task.hpp (2)
src/spider/core/Data.hpp (8)
  • Data (14-14)
  • Data (16-16)
  • Data (16-16)
  • Data (18-18)
  • nodiscard (20-20)
  • nodiscard (22-22)
  • nodiscard (24-26)
  • nodiscard (28-28)
src/spider/core/TaskGraph.hpp (8)
  • nodiscard (54-59)
  • nodiscard (61-66)
  • nodiscard (68-77)
  • nodiscard (79-88)
  • nodiscard (91-94)
  • nodiscard (98-100)
  • nodiscard (102-104)
  • nodiscard (110-113)
src/spider/storage/MetadataStorage.hpp (6)
src/spider/client/Job.hpp (2)
  • conn (180-198)
  • status (91-123)
src/spider/core/Task.hpp (4)
  • client_id (148-148)
  • client_id (148-148)
  • id (186-186)
  • id (186-186)
src/spider/storage/mysql/MySqlStorage.hpp (1)
  • batch (127-132)
src/spider/core/TaskGraph.hpp (12)
  • id (54-54)
  • id (61-61)
  • id (68-69)
  • id (79-80)
  • id (106-106)
  • id (106-106)
  • id (108-108)
  • id (108-108)
  • task (22-38)
  • task (22-22)
  • task (41-48)
  • task (41-41)
src/spider/client/Driver.hpp (1)
  • job_ids (309-317)
src/spider/core/TaskGraphImpl.hpp (2)
  • task (322-344)
  • task (322-322)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: non-storage-unit-tests (ubuntu-24.04)
  • GitHub Check: non-storage-unit-tests (ubuntu-22.04)
  • GitHub Check: lint
🔇 Additional comments (85)
taskfile.yaml (1)

9-9: Updated Include Path for Utils
The include path for the utils task has been updated to "tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml", in line with the restructured directory layout in the updated yscope-dev-utils. Please verify that all references to this file elsewhere in the project have been adjusted accordingly.

test-tasks.yaml (3)

64-67: Consistent Variable Naming for Checksum Validation
The task :utils:checksum:validate now utilises the INCLUDE_PATTERNS variable with the value ["{{.OUTPUT_DIR}}"]. This update is consistent with the new naming conventions introduced in the project. Ensure that any downstream tasks referencing these variables are updated accordingly.


69-73: Updated Venv Creation Command
The :utils:misc:create-venv task has been updated with the LABEL now set to "lint" and the REQUIREMENTS_FILE pointing to "{{.ROOT_DIR}}/lint-requirements.txt". This change aligns the environment setup with linting requirements instead of test-related ones. Confirm that no other tasks depend on the previous test requirements file.


75-78: Checksum Compute Task Update
The task :utils:checksum:compute now includes the INCLUDE_PATTERNS configuration, which matches the styling used in other tasks. This change maintains consistency across the checksum tasks.

lint-tasks.yaml (5)

35-35: Updated Path for C++ Configuration Files
The cpp-configs task now points to "tools/yscope-dev-utils/exports/lint-configs/symlink-cpp-lint-configs.sh", reflecting the new directory structure in yscope-dev-utils. Ensure that this file exists at the specified location and that all dependent tasks are updated to use this path.


47-64: Refined C++ Formatting Check Task
The cpp-format-check task has been modified to use the :utils:cpp-lint:clang-format command with the --dry-run flag. The updated INCLUDE_FILENAME_PATTERNS and ROOT_PATHS (referencing the wildcard patterns) should broaden the scope of files being checked. Please verify that these patterns cover all the necessary file types in your project.


66-74: Refined C++ Formatting Fix Task
The cpp-format-fix task now mirrors the check task by using the -i flag for in-place fixes via :utils:cpp-lint:clang-format. Confirm that the file pattern configurations remain appropriate for the project's file structure.


150-150: Updated YAMLLint Configuration Path
The yml task now references the updated configuration file "tools/yscope-dev-utils/exports/lint-configs/.yamllint.yml". This change ensures consistency with the new exports directory.


202-216: Updated Lint Venv and Checksum Tasks
The lint virtual environment task has been updated as follows:

  • The checksum validation task now uses INCLUDE_PATTERNS with the output directory.
  • The venv creation task (:utils:misc:create-venv) now sets LABEL to "lint" and uses "{{.ROOT_DIR}}/lint-requirements.txt".
  • The checksum computation task similarly adopts the new INCLUDE_PATTERNS variable.

These changes standardise variable naming and task configurations in line with recent updates. Please ensure compatibility with the CI/CD pipeline.

tools/yscope-dev-utils (1)

1-1: Subproject Commit Update Confirmed

The subproject commit has been updated to d22183ffa3fb95745b012eb38a6e13b7e5f06fca as per the new dependency requirements. This update aligns well with the updated clang-format rules and overall objectives of the PR.

src/spider/worker/TaskExecutor.cpp (1)

129-137: Formatting update in get_error method.
The reformatting of the .value_or() chain and tuple construction now adheres better to the updated clang-format rules, making the code easier to read while leaving the functionality intact.

tests/storage/test-MetadataStorage.cpp (1)

1-562: Overall formatting improvements in test cases.
The adjustments to line breaks, indentation, and blank line removals significantly improve readability and consistency across the test file. The logic of the tests remains unchanged.

🧰 Tools
🪛 Cppcheck (2.10-2)

[error] 74-74: syntax error

(syntaxError)

src/spider/worker/WorkerClient.hpp (1)

34-36: Refined method signature for get_next_task.
Consolidating the parameter list into a single line improves clarity and consistency with our formatting guidelines. There are no behavioural changes.

src/spider/scheduler/scheduler.cpp (2)

93-95: Improved formatting for connection retrieval in heartbeat_loop.
The restructured multiline use of std::move and std::get enhances readability while preserving the original logic of obtaining the storage connection.


131-133: Enhanced clarity in cleanup_loop storage connection assignment.
The revised formatting for retrieving the storage connection using std::move now fits the updated style guidelines, with no impact on functionality.

src/spider/storage/mysql/MySqlStorageFactory.hpp (1)

22-23: Consistent signature formatting in provide_storage_connection.
Joining the method name with its return type into a single line improves the overall clarity of the declaration. This is a cosmetic change that maintains the method’s functionality.

src/spider/worker/message_pipe.hpp (1)

16-17: Reformatted Function Signature Improves Readability.
The updated layout for the receive_message_async function declaration — where the parameter and return type now appear on a single line — cleanly adheres to the new clang-format rules while preserving the original functionality.

src/spider/client/Job.hpp (1)

1-351: Cosmetic Formatting Adjustments in Job.hpp.
The modifications that reformat exception throw statements (e.g. in wait_complete() and get_status()) enhance overall readability. These changes are cosmetic only and maintain the intended logic and functionality.

src/spider/worker/message_pipe.cpp (1)

87-143: Consistent Reformatting for Async Message Reception.
The revised formatting of the receive_message_async function signature (lines 87–88) as well as the overall asynchronous read logic improves clarity without altering the execution logic. All asynchronous operations and error handling remain correct.

tests/worker/test-TaskExecutor.cpp (2)

1-33: Cosmetic Adjustments in Test File.
Overall formatting improvements—including changes to the get_environment_variable function signature—enhance readability. These adjustments are strictly cosmetic and do not affect the underlying test logic or outcomes.


35-37: Enhanced Template Parameter Formatting.
The splitting of the template parameters for the return type of get_environment_variable onto separate lines (lines 35–37) makes the code easier to read and maintain, aligning with the updated clang-format style.

src/spider/storage/mysql/MySqlConnection.cpp (1)

19-20: Reformatted MySqlConnection::create Signature for Consistency.
Consolidating the function signature into a single line improves clarity while matching the declaration in the corresponding header. The functional behaviour remains unchanged, and the new formatting aligns well with project conventions.

src/spider/scheduler/SchedulerPolicy.hpp (1)

19-21: Formatting Update for schedule_next Method Signature.
The updated formatting of the virtual function declaration improves readability and maintains consistency with the new clang-format rules. No functional changes have been introduced.

src/spider/scheduler/SchedulerServer.cpp (1)

117-118: Reformatted process_message Signature.
The changes clearly separate the return type onto a new line, which enhances readability without modifying the method’s functionality.

src/spider/io/msgpack_message.cpp (2)

140-142: Enhanced Readability for read_ext_body_size Call.
The reformatting on these lines makes the call to read_ext_body_size clearer. Functionality remains unchanged as the logic is intact.


167-263: Reformatted receive_message_async Function.
The function signature and body were reformatted to improve the overall code clarity and consistency with the project’s formatting rules. There are no behavioural changes.

src/spider/core/TaskContextImpl.hpp (1)

29-37: Consistent Formatting for Getter Methods.
The updated formatting for both get_metadata_store and get_storage_factory aligns with the new style guidelines and retains the original functionality.

src/spider/io/msgpack_message.hpp (1)

20-21: Reformatted Declaration of receive_message_async.
This change consolidates the function declaration into a more concise and consistent format with the rest of the codebase. No functional modifications are present.

src/spider/worker/FunctionManager.cpp (2)

17-18: Consistent formatting in response_get_error signature.
The refactoring unifies the return type with the function declaration, improving readability without affecting functionality.


66-67: Improved formatting in response_get_result_buffers signature.
Aligning the return type on the same line enhances consistency across the codebase and follows the updated clang-format conventions.

src/spider/scheduler/FifoPolicy.cpp (2)

28-30: Enhanced signature formatting for schedule_next.
Changing the signature to a single-line format increases clarity and ensures consistency with other functions in the project.


43-44: Consistent declaration formatting for pop_next_task.
This cosmetic update simplifies the method declaration without altering its functionality, contributing to uniform style throughout the codebase.

src/spider/storage/StorageFactory.hpp (2)

18-20: Streamlined signature for provide_storage_connection.
Placing the return type on the same line as the function name improves readability and aligns with formatting standards used in other parts of the code.


21-23: Refined formatting for provide_job_submission_batch.
The unified declaration enhances consistency across the storage interface definitions, making the code easier to read and maintain.

src/spider/worker/WorkerClient.cpp (1)

44-45: Reformatted signature for get_next_task.
Removing the extraneous line break results in a cleaner, single-line method signature that is consistent with its header declaration.

src/spider/storage/mysql/MySqlStorage.cpp (3)

872-882: Improved Formatting of parse_timestamp
The reformatting of the parse_timestamp function now presents the signature and return type in a clear, consistent manner. The logic remains unchanged, and the updated formatting aligns well with the new clang-format rules.


1412-1469: Reformatted create_task_instance Method
The create_task_instance method has been carefully reformatted to enhance readability and bring consistency across the codebase. The function’s logic is untouched, so this change purely improves the visual structure and maintainability.


2248-2252: Refined SQL Query Formatting in remove_dangling_data
The edited segment in the remove_dangling_data method now uses a cleaner layout for the SQL query. This makes the query easier to read and maintain, without affecting its functionality.

src/spider/storage/mysql/MySqlConnection.hpp (2)

34-36: Consistent Method Signature for create
The updated signature for the create method now conforms to the project's formatting guidelines. Presenting the return type immediately following the parameter list helps improve clarity and consistency.


37-39: Constructor Formatting Revision
The MySqlConnection constructor has been reformatted to remove the extraneous semicolon and to use a braced initializer. This minor change enhances consistency and adheres to the updated code style guidelines.

src/spider/core/TaskGraphImpl.hpp (3)

31-32: The formatting update looks good.

The method signature formatting has been updated to align the arrow and return type with the method name, which improves readability.


102-106: The function call formatting looks consistent.

The multi-line formatting for the set_data_id call with the closing parenthesis on its own line follows the updated code style.


136-137: Method signature formatting updated appropriately.

This change maintains consistency with the other method signature formatting in the file.

src/spider/storage/mysql/MySqlStorageFactory.cpp (2)

28-29: Method signature formatting looks good.

The method signature has been updated to follow the consistent style pattern with the return type arrow on a new line.


38-39: Method signature formatting is consistent.

This formatting change aligns with the updated style guidelines and matches other method signatures in the codebase.

src/spider/client/Driver.hpp (2)

186-187: Method signature formatting is appropriately updated.

The formatting change for the templated start method improves readability by aligning the return type arrow on a new line.


250-251: Consistent method signature formatting.

The formatting of this overloaded start method now matches the style of the first one, maintaining consistency throughout the file.

src/spider/core/TaskGraph.hpp (4)

68-69: Method signature formatting updated correctly.

The get_child_tasks method signature has been reformatted to follow the consistent code style.


79-80: Consistent method signature formatting.

The formatting change for get_parent_tasks matches the updated style guidelines.


91-92: Method signature formatting looks good.

The formatting of the get_tasks method signature now aligns with the project's code style.


110-111: Method signature formatting is consistent.

The get_dependencies method signature formatting has been updated to match the style used throughout the codebase.

src/spider/client/TaskContext.hpp (2)

132-138: Formatting Update for start (TaskFunction) Method:
The function signature for starting a task (using a TaskFunction) has been reformatted so that the return type is cleanly aligned with the method name and parameters. This enhances readability while preserving functionality.


190-226: Formatting Update for start (TaskGraph) Method:
The signature for starting a task graph now aligns the return type with the rest of the declaration. This consistent formatting improves maintainability without altering the logic.

src/spider/worker/FunctionManager.hpp (4)

90-92: Consistent Formatting for response_get_error:
The updated declaration now places the return type on a new line with proper alignment. This minor reformatting increases clarity while maintaining the original functionality.


164-166: Reformatted response_get_result_buffers:
The return type has been realigned for consistency with other function declarations. This change is purely cosmetic and improves code readability.


220-231: Updated Overloaded create_args_request Signature:
Moving the return type to a new aligned line enhances clarity and consistency across the file. No functional changes have been introduced.


238-240: Formatting Update for apply in FunctionInvoker:
The refactored function signature now has its return type separated and aligned, which improves readability. The core logic remains unaffected.

src/spider/core/Task.hpp (4)

21-29: Formatting Update for TaskInput Constructors:
The constructors for TaskInput have been reformatted to use brace-enclosed definitions (with {}) instead of trailing semicolons. This change results in a cleaner and more consistent style.


31-33: Consistent Constructor Formatting in TaskInput:
The explicit constructor handling a boost::uuids::uuid now unambiguously sets both m_data_id and m_type. This minor reformatting improves overall code clarity.


35-39: Reformatted get_task_output Method:
The method declaration now places the return type on the same line as the method declaration, fostering consistency and easier comprehension.


150-153: Updated Formatting for set_job_creation_time:
The signature for setting the job creation time is now formatted with the return type aligned on the same line. This adjustment improves uniformity with other method declarations.

src/spider/worker/worker.cpp (6)

82-84: Reformatted Return Type for get_environment_variable:
The return type declaration now spans multiple, aligned lines. This consistency with updated clang-format rules aids readability across the file.


123-125: Clearer Connection Retrieval in heartbeat_loop:
Splitting the std::move and std::get call over several lines clarifies the connection extraction process without affecting functionality.


144-146: Reformatted fetch_task Function Signature:
Reorganising the function signature to separate the function name from the return type enhances clarity and aligns with the overall formatting improvements.


160-161: Consistent Signature Formatting for get_args_buffers:
The adjusted declaration now aligns the return type on a new line. This maintains uniformity with similar functions and improves code clarity.


191-193: Updated Formatting for parse_outputs:
The refactored signature with the return type aligned on a new line makes the declaration more legible without causing any functional changes.


437-439: Consistent Connection Retrieval in main:
Breaking up the std::move and std::get calls into separate lines creates a clearer, more maintainable connection retrieval.

src/spider/storage/DataStorage.hpp (9)

25-28: Reformatted Signature for add_driver_data:
The updated formatting aligns the return type on its own line, enhancing clarity and consistency with other virtual method declarations.


29-32: Reformatted Signature for add_task_data:
Changing to a multi-line declaration with aligned return type improves readability without altering the underlying functionality.


37-40: Reformatted Signature for add_task_reference:
The new formatting style clearly separates parameters and the return type, which assists in long-term maintainability.


41-46: Reformatted Signature for remove_task_reference:
Aligning the return type with the closing parenthesis improves the overall consistency of the virtual method declarations.


47-52: Reformatted Signature for add_driver_reference:
The method signature has been updated to a multi-line format that enhances clarity while preserving its original intent.


53-58: Reformatted Signature for remove_driver_reference:
This adjustment aligns the parameters and return type neatly, contributing to a uniform code style in the abstract class.


61-62: Reformatted Signature for add_client_kv_data:
The declaration now features a neatly aligned return type, which aids in consistent code style without any functional changes.


65-71: Reformatted Signature for get_client_kv_data:
The multi-line format for this method improves readability by clearly separating the parameters from the return type.


72-78: Reformatted Signature for get_task_kv_data:
Aligning the return type and parameters in a multi-line declaration furthers consistency across similar methods, raising overall code clarity.

src/spider/storage/mysql/MySqlStorage.hpp (8)

78-79: Reformatting of 'get_task' Signature
The method signature for get_task has been consolidated into a single line, which is in keeping with the new clang-format guidelines. Please ensure this formatting style is used consistently across similar methods in the codebase.


87-88: Reformatting of 'add_task_instance' Signature
The signature for add_task_instance has been reformatted to a more compact, single-line structure. This cosmetic change does not affect functionality and adheres to the updated clang-format rules.


100-102: Reformatting of 'get_child_tasks' Signature
The get_child_tasks method signature has been adjusted to reduce unnecessary line breaks. This reformatting improves readability while preserving the original functionality.


106-108: Reformatting of 'heartbeat_timeout' Signature
The layout for the heartbeat_timeout method has been updated to spread the signature over multiple lines, enhancing clarity. No changes to the business logic have been made.


111-116: Reformatting of Scheduler Methods
Both the get_scheduler_addr and set_scheduler_state method signatures have been reformatted according to the new clang-format rules. This update improves consistency and readability across the scheduler-related interfaces.


133-134: Reformatting of 'fetch_full_task' Function
The private static function fetch_full_task now utilizes a concise, single-line signature format. This change is purely cosmetic and aligns with the updated formatting standards.


151-152: Reformatting of 'get_data' Signature
In the MySqlDataStorage section, the get_data method signature has been reformatted to match the new style guidelines. All changes are aesthetic and do not alter the underlying logic.


175-176: Reformatting of 'add_client_kv_data' Signature
The add_client_kv_data method has been updated to a more succinct signature format as per the new clang-format rules. This enhances consistency across the storage interfaces without impacting functionality.

src/spider/storage/MetadataStorage.hpp (1)

31-138: Uniform Reformatting of Method Signatures
All changed segments in this file reflect a systematic reformatting of method signatures—from add_scheduler to set_scheduler_state—to comply with the updated clang-format rules introduced by the new yscope-dev-utils version. These alterations are purely cosmetic. Please verify that the revised formatting aligns with the overall project style guidelines and maintains readability in all storage interfaces.

@davidlion davidlion changed the title chore: Update yscope-dev-utils version and reformat source files refactor: Update yscope-dev-utils and apply latest clang-format settings. Apr 4, 2025
@sitaowang1998
sitaowang1998 merged commit 0a763de into y-scope:main Apr 5, 2025
@sitaowang1998
sitaowang1998 deleted the dev-utils branch April 5, 2025 00:33
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.

2 participants