ci: Parallelize clang-tidy - #94
Conversation
WalkthroughThis pull request updates various linting and build configuration files while applying widespread cosmetic changes to C++ source and header files. The linting workflow now uses a command that leverages all available CPU cores, and dependency versions have been updated. Additionally, multiple task definitions and paths in YAML configuration files have been reorganized. In the C++ code, the modifications consist chiefly of formatting adjustments such as the removal of extraneous blank lines and reformatting of function signatures to improve readability, without altering the underlying functionality. Changes
Possibly related PRs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/spider/io/msgpack_message.cpp (1)
241-248:⚠️ Potential issuePotential error code mismatch in asynchronous message reading.
In the
receive_message_asyncfunction, after reading the message body, the error check currently comparesboost::asio::error::eofwithbody_size_ecrather than withbody_ec. This appears to be an oversight; the comparison should be made withbody_ecto ensure correct error handling.Suggested diff:
- if (boost::asio::error::eof != body_size_ec) { + if (boost::asio::error::eof != body_ec) {
🧹 Nitpick comments (2)
src/spider/client/Job.hpp (1)
226-229: Consistent Exception Formatting for Insufficient Output Tasks
The reformatting of the exception thrown for insufficient output tasks now spans multiple lines, which noticeably improves readability and clearly separates the exception construction from the formatting logic. This style is both modern and consistent with similar changes elsewhere in the file.src/spider/storage/StorageFactory.hpp (1)
18-23: Enhanced Signature FormattingThe reformatting of the method declarations for
provide_storage_connectionandprovide_job_submission_batchsignificantly improves readability by placing the return types on the same line as the method names. This change is stylistic only and does not affect the functionality.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (74)
.github/workflows/code-linting-checks.yaml(1 hunks)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/Process.hpp
- src/spider/storage/mysql/MySqlJobSubmissionBatch.cpp
- src/spider/worker/TaskExecutorMessage.hpp
- src/spider/core/Data.hpp
- src/spider/worker/DllLoader.hpp
- src/spider/core/JobMetadata.hpp
- tests/utils/CoreTaskUtils.cpp
- src/spider/scheduler/SchedulerServer.hpp
- tests/client/client-test.cpp
- src/spider/worker/FunctionNameManager.cpp
- tests/io/test-MsgpackMessage.cpp
- src/spider/scheduler/FifoPolicy.hpp
- src/spider/worker/task_executor.cpp
- src/spider/client/type_utils.hpp
- tests/storage/test-DataStorage.cpp
- src/spider/worker/Process.cpp
- src/spider/worker/FunctionNameManager.hpp
- src/spider/client/Data.hpp
- src/spider/utils/LruCache.hpp
- tests/client/test-Driver.cpp
- src/spider/client/Driver.cpp
- tests/worker/test-Process.cpp
- src/spider/core/Error.hpp
- src/spider/worker/DllLoader.cpp
- tests/storage/StorageTestHelper.hpp
- tests/utils/CoreDataUtils.hpp
- src/spider/scheduler/SchedulerMessage.hpp
- src/spider/storage/mysql/MySqlJobSubmissionBatch.hpp
- src/spider/core/DataImpl.hpp
- tests/scheduler/test-SchedulerServer.cpp
- src/spider/core/Driver.hpp
- src/spider/client/task.hpp
- tests/utils/CoreTaskUtils.hpp
- src/spider/storage/StorageConnection.hpp
- src/spider/worker/TaskExecutor.hpp
- src/spider/client/TaskContext.cpp
🧰 Additional context used
🧬 Code Definitions (9)
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/scheduler/FifoPolicy.cpp (1)
src/spider/scheduler/FifoPolicy.hpp (1)
worker_addr(32-32)
src/spider/storage/mysql/MySqlConnection.cpp (1)
src/spider/storage/mysql/MySqlConnection.hpp (1)
url(34-35)
src/spider/client/TaskContext.hpp (2)
src/spider/core/TaskGraph.hpp (4)
task(22-38)task(22-22)task(41-48)task(41-41)src/spider/core/TaskGraphImpl.hpp (2)
task(322-344)task(322-322)
src/spider/worker/WorkerClient.cpp (1)
src/spider/worker/WorkerClient.hpp (1)
fail_task_id(34-35)
src/spider/client/Driver.hpp (2)
src/spider/core/TaskGraphImpl.hpp (2)
task(322-344)task(322-322)src/spider/core/TaskGraph.hpp (4)
task(22-38)task(22-22)task(41-48)task(41-41)
src/spider/storage/mysql/MySqlStorage.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-22.04)
- GitHub Check: non-storage-unit-tests (ubuntu-24.04)
- GitHub Check: lint
🔇 Additional comments (84)
src/spider/client/Job.hpp (2)
270-273: Enhanced Error Reporting in Msgpack Unpack Catch Block
The multi-line formatting of the thrown exception in the catch block formsgpack::type_errorsignificantly improves clarity. The separation of the exception keyword and the formatted message helps ensure that the error details are immediately apparent upon inspection.
307-310: Uniform Exception Handling for Data Retrieval Failures
The updated formatting when throwing aConnectionExceptionafter a failed data retrieval is consistent with other exception cases in this file. This uniformity aids maintainability and enhances the overall readability of error handling throughout the function.tests/worker/test-TaskExecutor.cpp (1)
1-250: Overall, the test suite is well-structured and continues to validate TaskExecutor functionality correctly.The formatting and style improvements enhance readability without changing test logic.
🧰 Tools
🪛 Cppcheck (2.10-2)
[error] 63-63: syntax error
(syntaxError)
src/spider/worker/TaskExecutor.cpp (1)
129-137: Refactoredget_errormethod formatting for clarity.The return statement for
get_errorhas been reformatted into a more compact, single-line style (spread over multiple indented lines) without altering its functionality. This change improves readability and aligns with the modern C++ style adopted elsewhere in the file.src/spider/worker/WorkerClient.hpp (1)
34-36: Updatedget_next_taskmethod signature formatting.The declaration of
get_next_taskhas been adjusted so that the return type is on the same line as the parameter list. This enhances consistency and readability across the codebase.src/spider/io/msgpack_message.cpp (1)
140-142: Improved formatting for reading body size.The multi-line call to
read_ext_body_sizenow clearly shows the conversion of the body size vector to astd::u8string_view, thereby improving the readability of the code.src/spider/io/msgpack_message.hpp (1)
20-22: Refactoredreceive_message_asyncdeclaration for consistent formatting.The updated declaration now places the return type on the same line as the function signature, aligning it with the implementation and making the code easier to read.
src/spider/worker/message_pipe.cpp (1)
87-88: Formatting Improvement forreceive_message_async:
The updated function signature now places the return type immediately after the parameter list, which improves readability. Please ensure that the corresponding declaration in the header file stays consistent with this change.src/spider/worker/WorkerClient.cpp (1)
44-45: Signature Formatting Update forget_next_task:
The revised signature forget_next_tasknow neatly aligns the closing parenthesis with the return type. This change enhances code readability without affecting functionality.src/spider/worker/message_pipe.hpp (1)
16-17: Improved Declaration Readability forreceive_message_async:
The function declaration now uses a single-line format for the return type, which increases clarity. The change is purely stylistic and aligns nicely with the implementation.src/spider/worker/FunctionManager.cpp (2)
17-18: Signature Refinement forresponse_get_error:
The updated formatting moves the return type to the same logical block as the parameter list. This consistent style improves readability and maintains clarity in the code.
66-67: Consistent Formatting forresponse_get_result_buffers:
The revised signature now places the return type directly after the parameter list, aligning with the project’s visual style guidelines. There are no functional changes, and the update aids in maintaining a clean codebase.src/spider/worker/FunctionManager.hpp (3)
90-91: Declaration Update forresponse_get_error:
The reformatting of the function signature into a more compact layout enhances readability. It is important that both the declaration and the definition remain in sync.
164-165: Formatting Enhancement forresponse_get_result_buffers:
This updated declaration improves the clarity and consistency of the code style. No functionality has been altered.
220-222: Inline Function Signature Refinement forcreate_args_request:
The revised inline declaration now clearly presents the return type on the same line, thereby streamlining the visual structure. This change is purely cosmetic and supports overall maintainability.src/spider/worker/worker.cpp (6)
83-84: Reformatting of theget_environment_variablesignature.
The splitting of the return type across separate lines improves clarity and consistency. The changes are purely cosmetic and maintain the same functionality.
144-146: Enhanced readability in thefetch_taskfunction declaration.
Breaking the function declaration into multiple lines makes the signature easier to read and maintain. No functional changes are introduced here.
160-161: Improved clarity in theget_args_buffersfunction signature.
The reformatting clearly separates the function name and its return type, enhancing legibility without changing any behaviour.
191-193: Readability boost for theparse_outputsfunction signature.
The adjustment to the function’s declaration by placing the return type on a new line substantially improves formatting, while leaving functionality intact.
304-306: Clear structuring of the storage connection move operation.
The revised formatting for thestd::moveexpression enhances visual clarity and makes it easier to track the extraction of the storage connection.
437-439: Consistent formatting applied in the main function for connection extraction.
The similar reformatting here mirrors the improvements seen in other parts of the file; it increases readability and supports easier future maintenance.tools/yscope-dev-utils (1)
1-1: Commit Hash Update VerificationThe subproject commit has been updated to
d22183ffa3fb95745b012eb38a6e13b7e5f06fca, which aligns with the intended improvements for parallelising clang-tidy. Please ensure that any dependent configurations in files such aslint-tasks.yamland version constraints inlint-requirements.txthave been verified to work correctly with this update.tests/storage/test-MetadataStorage.cpp (2)
437-438: Formatting Improvement in Task Finish CallThe adjusted formatting of the closing parenthesis for the
task_finishcall (lines 437–438) improves readability by clearly grouping the call’s parameters. No functionality changes have been introduced.
509-514: Consistent Formatting in Job Reset’s Task Finish CallThe refactoring of the
task_finishcall in the job reset test (lines 509–514) aligns parameters and the closing parenthesis more clearly, which enhances overall clarity. This change is purely cosmetic and retains the original behaviour.taskfile.yaml (1)
9-9: Updated Path for Utils in TaskfileThe
utilsentry in theincludessection now points to
tools/yscope-dev-utils/exports/taskfiles/utils/utils.yaml
which reflects the new directory structure for utility files. This update improves consistency across the project..github/workflows/code-linting-checks.yaml (1)
52-52: Parallelised Linting CommandThe lint job command now includes the
-C $(nproc)option, enabling concurrent execution based on available CPU cores. This change should significantly reduce the runtime of the linting process.lint-requirements.txt (1)
1-7: Updated Linting Tool Version ConstraintsThe version constraint for
clang-formathas been updated to require version 20.1.0 or higher, and the dependency foryamllinthas been refined. These modifications ensure compatibility with the updated lint tasks and take advantage of improvements in the newer tool versions.src/spider/scheduler/scheduler.cpp (2)
93-95: Improved Formatting of Storage Connection Retrieval in Heartbeat LoopThe extraction of the storage connection from the variant in the heartbeat loop has been split over multiple lines for enhanced readability. This reformatting does not affect functionality but makes the code easier to follow.
131-133: Enhanced Clarity in Storage Connection Extraction in Cleanup LoopSimilarly, the multi‐line extraction of the storage connection in the cleanup loop (lines 131–133) improves clarity and consistency. The underlying logic remains unaffected.
src/spider/scheduler/SchedulerPolicy.hpp (1)
19-21: Proper reformatting of the schedule_next signature.
The breaking of the return type onto a separate line improves readability while preserving the intended interface.src/spider/storage/mysql/MySqlStorageFactory.hpp (1)
22-23: Clean signature update for provide_storage_connection.
The changes to the method signature—placing the return type on the same line—enhance clarity and consistency with our style guidelines.src/spider/scheduler/SchedulerServer.cpp (1)
117-118: Return type reformatting for process_message is correct.
Moving the return type to its own line makes the method signature more legible without affecting the overall functionality.src/spider/scheduler/FifoPolicy.cpp (2)
28-30: Reformatting of schedule_next signature is appropriate.
Splitting the signature across multiple lines improves readability and aligns with the consistent style applied across the codebase.
43-44: Consistent update for pop_next_task signature.
The adjustment to the return type placement is a clean cosmetic change that enhances the overall clarity of the function declaration.src/spider/storage/mysql/MySqlConnection.cpp (1)
19-20: Updated function signature for MySqlConnection::create is well structured.
The new formatting—placing the return type on a new line—improves readability while retaining the complete functionality and error handling of the method.src/spider/client/TaskContext.hpp (2)
132-133: Consistent Formatting for Task Start MethodThe updated formatting for the
startmethod (for tasks) now places the return type on the same line as the function declaration, which enhances clarity and consistency with other function definitions.
190-191: Consistent Formatting for Task Graph Start MethodSimilarly, the
startmethod for task graphs has been refactored to consolidate its return type with the declaration, ensuring consistency and better readability throughout the code.test-tasks.yaml (3)
64-67: Updated Task Dependency and Variable NamingThe dependency task has been updated to
":utils:checksum:validate", and the introduction of theINCLUDE_PATTERNSvariable (using the output directory) aligns with the overall reorganisation. These changes contribute to a more consistent naming convention across tasks.
69-73: Refined Virtual Environment Creation TaskThe change of the task name to
":utils:misc:create-venv"alongside the update of theLABELvariable to"lint"and the switch ofREQUIREMENTS_FILEto the lint-specific version demonstrate a clear intent to support linting tasks. This improves clarity and aligns with updated project conventions.
75-78: Consistent Checksum Task UpdateThe update to
":utils:checksum:compute"and the corresponding variable changes are consistent with earlier updates and reflect the improved task structure.src/spider/storage/mysql/MySqlConnection.hpp (2)
34-35: Improved Method Declaration ClarityThe reformatting of the static
createmethod signature simplifies the declaration by placing the return type on the same line as the function name. This change promotes consistency and enhances readability without altering functionality.
37-38: Corrected Constructor Definition SyntaxChanging the constructor’s definition from ending with a semicolon to a brace ensures proper C++ syntax and aligns with standard constructor definitions. This correction improves clarity and adheres to coding standards.
src/spider/storage/mysql/MySqlStorage.cpp (4)
229-231: Improved Prepared Statement Formatting in add_task
The reformatting of the prepared statement instantiation (using multi-line breaks for clarity) in the add_task function enhances code readability. The change maintains functional correctness and aligns well with our code style conventions.
740-743: Enhanced SQL Query Formatting for Output Statement
Splitting the SQL query across multiple lines in the output statement of fetch_full_task greatly improves readability without altering the functionality. This formatting change makes it easier to inspect and maintain complex SQL queries.
872-882: Consistent and Clear Implementation of parse_timestamp
The updated formatting for the parse_timestamp function is clear and concise. Using std::get_time with proper error checking provides a robust conversion from a timestamp string to a system clock time point. There are no functional issues; the improvements are purely cosmetic and help maintain consistency.
2248-2252: Readable Multi-line SQL in remove_dangling_data
The multi-line formatting of the SQL statement in remove_dangling_data improves clarity and maintainability. It makes the subqueries more accessible at a glance. It would be worthwhile to monitor the performance of such subqueries, although the current structure is acceptable.src/spider/client/Driver.hpp (2)
185-190: Improved Declaration Formatting for start(TaskFunction…)
The revised method signature for the start function that accepts a TaskFunction now places the return type on the same line (using the trailing return type syntax). This new formatting increases the readability and consistency of method declarations without impacting functionality.
249-252: Consistent Formatting for start(TaskGraph…)
Similarly, the start method for TaskGraph now has its return type specified immediately after the parameter list. This change standardises the interface and makes the code easier to read and maintain.src/spider/core/TaskGraphImpl.hpp (3)
31-32: LGTM: Improved method signature formattingThe reformatted method signature with the arrow (
->) on a separate line improves readability, especially for complex return types.
102-106: LGTM: Enhanced readability with multi-line formattingBreaking the
set_data_idcall into multiple lines improves code readability for this nested expression chain.
136-137: LGTM: Consistent method signature formattingThis change follows the same formatting pattern as other methods, improving consistency throughout the codebase.
src/spider/core/TaskContextImpl.hpp (2)
29-30: LGTM: Improved method signature formattingThe reformatted method signature enhances readability by placing the return type on a separate line.
34-35: LGTM: Consistent method signature formattingThis formatting change maintains consistency with other method signatures in the codebase.
src/spider/storage/mysql/MySqlStorageFactory.cpp (2)
28-29: LGTM: Enhanced method signature readabilityThe reformatted method signature improves readability for this complex return type.
38-39: LGTM: Consistent method signature formattingThis change follows the same formatting pattern applied to other methods throughout the codebase.
src/spider/core/TaskGraph.hpp (4)
68-69: LGTM: Improved method signature formattingThe reformatted method signature enhances readability by placing the return type on a separate line.
79-80: LGTM: Consistent method signature formattingThis change maintains a consistent formatting style with other method signatures.
91-92: LGTM: Enhanced readability for complex return typeBreaking the long return type onto a separate line significantly improves readability.
110-111: LGTM: Consistent method signature formattingThis formatting change completes the consistent application of the same pattern throughout the file.
lint-tasks.yaml (7)
5-5: New Variable Addition for Clang-Tidy Directory
A new variableG_LINT_CLANG_TIDY_DIRhas been added to specify the directory for clang‐tidy outputs. This change helps standardise where output files are stored. Please verify that this variable is consistently used throughout the tasks that invoke clang‐tidy.
36-36: Updated Path for cpp-configs
Thecpp-configsvariable has been updated to point to"tools/yscope-dev-utils/exports/lint-configs/symlink-cpp-lint-configs.sh", which aligns with the new directory structure. Confirm that this path exists in the repository and is correct.
49-64: Consolidated Source File List for Clang-Format Check
The sources for thecpp-format-checktask have been refactored into an anchored list (cpp_source_files), now including configuration files such as.clang-formatand.clang-tidyalong with directories. This strengthens consistency; however, please review that the wildcard patterns correctly capture all intended files.
67-75: Consistent Usage in cpp-format-fix Task
Thecpp-format-fixtask now reuses the previously definedcpp_source_filesanchor, ensuring uniformity in file selection. This is a positive refactor with no apparent issues.
83-97: Enhanced clang-tidy Invocation in cpp-static-check
The task for clang‐tidy static checking has been restructured to use a dedicated utility (:utils:cpp-lint:clang-tidy-find) with flags specified as an array. The inclusion ofOUTPUT_DIRlinked to the newly added variable improves configuration clarity. Please confirm that the provided filename patterns and directory paths meet the project’s requirements.
134-144: Revised YAML Linting Configuration
The yml task now uses a configuration file located at"tools/yscope-dev-utils/exports/lint-configs/.yamllint.yml". This adjustment is well aligned with other linting task updates—ensure that all pertinent YAML files are addressed in the configuration.
176-191: Updated Virtual Environment Task Configurations
The venv tasks have been modified to use new utility names (e.g.:utils:misc:create-venvand:utils:checksum:compute) and updated checksum validation parameters. These changes align with the updated version ofyscope-dev-utilsand help ensure a more robust, parallelised linting process.src/spider/core/Task.hpp (3)
21-33: Improved Formatting for TaskInput Constructors
The constructors in theTaskInputclass have been reformatted (e.g. using initializer lists with proper line breaks andstd::move) to improve code readability. These cosmetic changes do not affect functionality but do enhance maintainability.
35-38: Streamlined get_task_output Method Signature
Theget_task_outputmethod definition has been condensed into a more concise format. This change aids readability without impacting functionality.
150-153: Reformatted set_job_creation_time in ScheduleTaskMetadata
Theset_job_creation_timemethod in theScheduleTaskMetadataclass has been reformatted into a clearer, single-line signature. This consistency in style is appreciated, as it does not alter the underlying logic.src/spider/storage/DataStorage.hpp (4)
25-32: Uniform Reformatting for add_driver_data and add_task_data
The method signatures foradd_driver_dataandadd_task_datahave been reformatted across multiple lines for enhanced clarity. This change is purely stylistic and does not impact functionality.
37-40: Consistent Formatting for add_task_reference
The signature ofadd_task_referencehas been adjusted to span multiple lines, promoting consistency with other function declarations.
47-52: Reformatted add_driver_reference Signature
Theadd_driver_referencemethod is now clearly presented over several lines. This cosmetic change improves readability while leaving the implementation intact.
65-78: Enhanced Clarity for Key-Value Data Methods
Bothget_client_kv_dataandget_task_kv_datahave been reformatted, with parameter lists clearly separated from the return type. This standardisation increases readability and maintainability.src/spider/storage/mysql/MySqlStorage.hpp (10)
78-80: Reformatted get_task in MySqlMetadataStorage
Theget_taskmethod signature has been adjusted for clarity by placing the return type and parameters on separate lines. This refactoring maintains functionality while adhering to the project's formatting standards.
87-88: Updated add_task_instance Formatting
Theadd_task_instancemethod now reflects the updated style guidelines. This clear layout aids in quick comprehension of the function signature without changing its logic.
100-102: Improved get_child_tasks Signature
Theget_child_tasksmethod has been reformatted to ensure consistency and readability. The change is cosmetic and does not affect functionality.
106-108: Refined Heartbeat Timeout Method Declaration
Theheartbeat_timeoutmethod now follows a consistent multi-line format. Ensure that the numerical parametertimeoutis being passed appropriately in all invocations.
109-113: Reorganized get_scheduler_addr Declaration
Theget_scheduler_addrmethod signature is now more uniformly formatted. Verify that output variables for the address and port are handled correctly in the implementation.
114-116: Consistent set_scheduler_state Formatting
The methodset_scheduler_statehas been reformatted for better consistency with other task-related methods. No functional change; the updated style improves visual clarity.
133-134: Standardised Static Method fetch_full_task
The static methodfetch_full_taskhas been reformatted to align with the new coding style. Although only a stylistic change, please ensure that callers of this function are updated if necessary.
151-152: Reformatted get_data in MySqlDataStorage
The methodget_datanow uses a clearer, multi-line format. This reformatting unambiguously separates parameters from the return type without affecting behaviour.
155-157: Updated add_task_reference in MySqlDataStorage
The reformatting ofadd_task_referenceenhances readability by splitting the declaration across multiple lines. Functionality remains unchanged.
175-177: Consistent Formatting for add_client_kv_data
The changes to theadd_client_kv_datamethod align with the overall formatting improvements throughout MySQL storage classes. Good consistency is maintained and no functional issues are introduced.src/spider/storage/MetadataStorage.hpp (1)
30-138: Uniform Reformatting Across MetadataStorage Declarations
The virtual method declarations inMetadataStoragehave been uniformly reformatted to separate the return types, parameters, and= 0specifiers across distinct lines. This enhancement greatly improves readability and consistency across the interface definitions. No functional behaviour has been altered. Please ensure that the implementations adhere to these updated style conventions.
davidlion
left a comment
There was a problem hiding this comment.
This PR seems to re-format everything (maybe because of a clang-format update or version bump). Let's separate that into its own PR so it isn't mixed with the clang-tidy update.
Unfortunately, the linting workflow will fail if code is not formatted. |
Description
Currently a run of clang-tidy on all files take at least 70 minutes in GH workflow. This pr updates
yscope-dev-utilstod22183fand incorporates its parallelized clang-tidy tasks in GH workflow.This pr also includes the changes in source files according to the latest
clang-formatrules.Checklist
breaking change.
Validation performed
clang-formatandclang-tidychecks pass in dev containerSummary by CodeRabbit
Chores
Refactor
Style
These internal enhancements aim to support a more robust development process while ensuring our system continues to run smoothly.