Skip to content

Conversation

@davidlion
Copy link
Member

@davidlion davidlion commented Mar 10, 2025

Description

This PR adds support for running clang-tidy through taskfiles and adds it to CI.
For now, clang-tidy will be fully run on all files using an exclude list (in lint-task.yaml) to skip files with known issues. Once existing issues are fixed we will switch to running clang-tidy only on files changed in a PR to save time. A nightly full run will be used to pick up other errors.

To support clang-tidy we've added/changed some tasks. Going from low-level to high-level:

  • check-cpp-static-diff: Run clang-tidy on files changed compared to a git reference (defaults to origin/HEAD)
  • check-cpp-static-full: Run clang-tidy against all files in CLP using a blacklist to avoid files with known errors.
    • As files are updated they should be removed from the blacklist.
  • check-cpp-diff: split of check-cpp that calls check-cpp-static-diff with check-cpp-format
  • check-cpp-full: split of check-cpp that calls check-cpp-static-full with check-cpp-format
  • check-no-cpp: split of check that calls all linting without any C++
  • check: now calls check-cpp-diff with all other linting

CI has been changed such that clp-lint.yaml calls check-no-cpp as clang-tidy must be run in an environment that can build clp. Therefore, the clp-core-build.yaml and clp-core-build-macos.yaml have been updated to also run check-cpp-full.

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

Tested tasks locally and CI through fork repo.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new linting tasks for JavaScript, Python, and YAML, along with enhanced C++ checks.
    • Added new tasks for generating and building core components.
    • Added a new job for linting in the Ubuntu Jammy environment.
  • Chores

    • Enhanced linting routines to provide more targeted code quality checks.
    • Updated tooling dependencies for improved linting performance, including the addition of clang-tidy.
    • Upgraded a core development utility to ensure smoother processes.
    • Added installation of additional packages (python3-pip and python3-venv) for enhanced functionality.
    • Updated documentation to clarify available workflows for contributors.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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-tasks.yml (1)

171-763: Comprehensive check-cpp-static-full task configuration.
This task invokes the full static analysis via the :utils:cpp-lint:clang-tidy-find command and comes with a very detailed configuration that includes an extensive exclusion list along with inline comments explaining the rationale (e.g., exclusion of .inc files due to circular inclusion issues).

  • Maintenance note: The long EXCLUDE_PATTERNS list may become unwieldy over time. Consider managing these exclusions in an external configuration file if the list grows further.
  • All flags, include patterns, and directory settings (such as OUTPUT_DIR and ROOT_PATHS) appear to be correctly specified.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bddf03e and 51f116f.

📒 Files selected for processing (1)
  • lint-tasks.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: ubuntu-jammy-deps-image
  • GitHub Check: centos-stream-9-deps-image
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: lint-check (macos-latest)
🔇 Additional comments (11)
lint-tasks.yml (11)

4-4: Added clang-tidy output directory variable.
The new variable G_LINT_CLANG_TIDY_DIR is introduced to designate where clang‐tidy outputs are stored. Please ensure this variable is used consistently throughout the lint tasks and that it points to the correct build directory.


10-15: Refactored check task with granular language-specific checks.
The check task now sequentially runs check-cpp-full, check-js, check-py, and check-yaml. This segmentation aligns with the PR objectives by splitting the C++ checks from those for other languages, thereby enhancing clarity. Please double-check that all downstream CI configurations reference the updated task names where needed.


16-20: New check-cpp-diff task for incremental C++ checks.
This task chains the formatting check (check-cpp-format) with a static diff analysis (check-cpp-static-diff). Verify that the referenced tasks exist and are invoked properly for incremental checking scenarios.


21-25: New check-cpp-full task for comprehensive C++ analysis.
By combining formatting and full static analysis (check-cpp-static-full), this task facilitates a complete verification of the C++ code. It is important to ensure that the full analysis does not adversely affect build time or CI stability.


26-30: Introduction of the check-no-cpp task.
This task deliberately excludes C++ linting while retaining checks for JavaScript, Python, and YAML. This design supports workflows where C++ checks might otherwise cause failures. Ensure that its usage is clearly documented for contributors and CI configurations.


32-38: Updated fix task to include both C++ and non-C++ fixes.
The fix task now triggers fix-cpp-full, fix-js, fix-py, and fix-yaml. This update consolidates the fixing routines and matches the overall task refactoring goals.


39-43: Added fix-cpp-diff task for incremental C++ fixes.
This task runs both fix-cpp-format and fix-cpp-static-diff to address smaller code issues. Ensure that this incremental fix mode integrates well with your overall development workflow.


44-48: Introduced fix-cpp-full task for complete C++ fixes.
By combining fixes for formatting and static issues, this task enables a thorough perfection of C++ source files. Make sure that the automated fixes are tested to avoid unexpected side effects.


49-53: fix-no-cpp task to manage non-C++ fixes separately.
This new task focuses on the non-C++ parts (i.e., JavaScript, Python, YAML), which helps isolate and address language-specific issues without running unnecessary C++ fix routines.


156-170: check-cpp-static-diff task configuration for incremental static analysis.
The task is configured with proper dependencies and flags—for example, the -p '{{.G_CORE_COMPONENT_BUILD_DIR}}' flag is used to specify the build directory. Please verify that the build directory variable indeed reflects the intended compile environment.


828-839: venv task configured to run only once.
The addition of run: "once" ensures that the virtual environment set up for linting is executed a single time per workflow run, which should improve overall efficiency. Confirm that this approach meets the project’s requirements in all deployment scenarios.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 (2)
lint-tasks.yml (2)

4-4: New Variable for clang-tidy Output Directory
The addition of G_LINT_CLANG_TIDY_DIR: "{{.G_BUILD_DIR}}/lint-clang-tidy" is well considered and fits neatly with the other build directory variables. Please ensure that its purpose and usage are documented in the project’s contribution guidelines.


171-764: Extensive Configuration in "check-cpp-static-full"
This task provides a comprehensive setup for running :utils:cpp-lint:clang-tidy-find on the full C++ codebase. The use of a detailed EXCLUDE_PATTERNS list—with comments explaining the rationale for excluding certain .inc files and addressing circular include issues—is thorough. However, the exclusion list is very long; it might be beneficial to move these patterns to an external configuration file or define them as a reusable variable/anchor to improve maintainability in the long term. Also, the inline YAML comment to disable the line-length rule is practical; just be sure that it does not inadvertently suppress important format warnings elsewhere.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 51f116f and 7948c73.

📒 Files selected for processing (1)
  • lint-tasks.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ubuntu-jammy-deps-image
  • GitHub Check: centos-stream-9-deps-image
🔇 Additional comments (10)
lint-tasks.yml (10)

11-14: Updated "check" Task to Invoke Full C++ Linting
The check task now calls "check-cpp-full" (alongside the JS, Python, and YAML checks) instead of a previous variant. This change supports the transition to full C++ analysis. Confirm that this meets the desired workflow, as diff-based checks are handled separately.


16-20: New Task "check-cpp-diff" for Incremental C++ Linting
The newly added check-cpp-diff task correctly combines check-cpp-format and check-cpp-static-diff, which should help in analysing only modified files. Please verify that the underlying variables (such as the git reference for changes) are defined elsewhere, and that the command order produces the intended output.


21-25: New Task "check-cpp-full" for Comprehensive C++ Linting
This task neatly groups the full C++ linting actions by calling check-cpp-format and check-cpp-static-full. It is important to ensure that full static analysis is performed in a timely manner, especially in CI.


26-30: New Task "check-no-cpp" Excluding C++ Checks
The check-no-cpp task now isolates non-C++ checks (JS, Python, YAML). This separation aids in environments where C++ linting with clang-tidy might be undesirable.


32-38: "fix" Task Updated to Use the Full C++ Fix Variant
The fix task now calls fix-cpp-full (along with tasks for JS, Python, and YAML). Ensure that users are aware that C++ fixes will always apply the full set of changes, as opposed to a diff-based fix, and that this behaviour aligns with their expectations.


39-43: New Task "fix-cpp-diff" for Incremental Fixes in C++
The newly introduced fix-cpp-diff task utilises both fix-cpp-format and fix-cpp-static-diff. This should allow for applying fixes only to changed portions of the code. Confirm that its integration with the corresponding check task is consistent.


44-48: New Task "fix-cpp-full" for Comprehensive C++ Fixes
This task correctly pairs fix-cpp-format with fix-cpp-static-full to address all C++ style and static issues. Its configuration looks consistent with the corresponding linting task.


49-54: New Task "fix-no-cpp" Excluding C++ Auto-fixes
The fix-no-cpp task is designed to run fixes only for JS, Python, and YAML files, thereby excluding C++ fixes. This separation is logical given the diff/full split for C++ handling.


156-170: New Task "check-cpp-static-diff" for Diff-Based Static Analysis
This task calls :utils:cpp-lint:clang-tidy-diff with the appropriate variables including FLAGS, OUTPUT_DIR, and VENV_DIR. Ensure that {{.G_CORE_COMPONENT_BUILD_DIR}} is correctly defined in the overall config, as it is crucial for clang-tidy to locate the build directory.


839-839: "venv" Task Now Runs Only Once
The addition of run: "once" in the venv task should prevent unnecessary re-creation of the virtual environment, which is a positive change for efficiency. Please verify in CI and local environments that this behaviour is as intended.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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-tasks.yml (1)

171-765: Comprehensive Configuration for check-cpp-static-full
This block provides a detailed setup for performing a full clang-tidy static analysis on C++ code. The configuration includes:

  • Documentation Comments: The inline notes explain why certain file types (e.g. .inc files) are excluded due to circular includes and false positives.
  • EXCLUDE_PATTERNS Array: The exclusion list is extensive to cover many specific files. While the detail is valuable, the list is quite long and might become challenging to maintain over time. Consider one of the following improvements:
    • External Configuration: Move the exclusion patterns to an external file or a separate YAML anchor that can be updated independently.
    • Advanced Glob Patterns: If applicable, explore using glob patterns to simplify the list and reduce redundancy.
  • FLAGS and Other Variables: The FLAGS array includes correct references to the clang-tidy configuration and build directory, which is good practice.
  • Overall Maintainability: The current configuration is precise and well-documented; however, ensure that the long list of exclusions is periodically reviewed to remove files that have been updated, as indicated in the comments.

This block is functionally comprehensive but may benefit from future refactoring aimed at enhancing maintainability and reducing redundancy.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d2190bb and 653ad79.

📒 Files selected for processing (2)
  • lint-requirements.txt (1 hunks)
  • lint-tasks.yml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lint-requirements.txt
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: ubuntu-jammy-deps-image
  • GitHub Check: centos-stream-9-deps-image
  • GitHub Check: lint-check (macos-latest)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: build-macos (macos-14, false)
🔇 Additional comments (11)
lint-tasks.yml (11)

4-4: New Variable for Clang-Tidy Output Directory
The addition of the variable G_LINT_CLANG_TIDY_DIR (set to "{{.G_BUILD_DIR}}/lint-clang-tidy") is clear and consistent with the other build directory variables. This change should help centralise the output location for clang‐tidy results.


11-14: Update to the Global Check Task
The check task now sequentially runs check-cpp-full, check-js, check-py, and check-yaml. This refactoring consolidates the C++ linting into the check-cpp-full task, which seems to be the desired approach. Ensure that replacing the old C++ check with check-cpp-full meets all workflow requirements.


16-20: Introduction of check-cpp-diff Task
This new task executes both check-cpp-format and check-cpp-static-diff. The naming is consistent and it provides a clear separation for differential static analysis. Verify that the behaviour of check-cpp-diff aligns with other diff tasks in the workflow.


21-25: Introduction of check-cpp-full Task
This task combines check-cpp-format and check-cpp-static-full to perform a comprehensive C++ analysis. The structure is clear and mirrors the differential task but for a full scan. Confirm that downstream consumers are updated to utilise this new task.


26-31: Creation of check-no-cpp Task
The new check-no-cpp task is designed to run checks for JavaScript, Python, and YAML only, explicitly omitting C++ checks. This should be useful in contexts where C++ linting is not required (e.g. in CI when clang‐tidy is expected to fail). Ensure that all relevant documentation reflects this change.


34-34: Addition in the fix Task for C++
By adding fix-cpp-full under the fix task, the refactoring now matches the split tasks for checking and fixing C++ code. This maintains consistency with the new check tasks.


39-43: New fix-cpp-diff Task
The fix-cpp-diff task now runs both fix-cpp-format and fix-cpp-static-diff. This mirrors the check counterpart and properly segments differential fixes for C++ issues.


44-48: New fix-cpp-full Task
Similarly, the fix-cpp-full task is set up to run fix-cpp-format and fix-cpp-static-full. This ensures that a full fix is applied when needed. Double-check the integration of these commands with the overall CI workflow.


49-54: New fix-no-cpp Task
The addition of the fix-no-cpp task to handle JavaScript, Python, and YAML fixes only is straightforward and consistent with the approach used for checking. It clearly isolates non‑C++ fixes from those intended for C++.


840-840: Venv Task: Single Run Directive
The update in the venv task adding run: "once" ensures that the virtual environment is created only once. This can improve efficiency by preventing redundant setup steps. Verify that this change does not interfere with scenarios that might require multiple venv initialisations.


156-170: check-cpp-static-diff Task Configuration
This task is configured to perform clang‐tidy analysis on files modified relative to a base reference. The commands and variables (e.g. FLAGS, OUTPUT_DIR, and VENV_DIR) are appropriately set. Please confirm that the git reference used (through dependency on :core-generate) and the build directory variable (G_CORE_COMPONENT_BUILD_DIR) are correctly defined elsewhere in the project.

@davidlion davidlion changed the title build(taskfile): Add tasks to run clang-tidy; Refactor existing C++ tasks. build(taskfile): Add tasks to run clang-tidy; Refactor existing C++ tasks; Add the new tasks to GH workflows. Mar 12, 2025
@davidlion davidlion requested a review from kirkrodrigues March 12, 2025 04:33
# - src/clp/ir/EncodedTextAst.cpp
# - tests/test-ffi_IrUnitHandlerInterface.cpp
# yamllint disable rule:line-length
EXCLUDE_PATTERNS:
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, forgot to mention in the first review, but can we alphabetize this list?

@kirkrodrigues
Copy link
Member

kirkrodrigues commented Mar 12, 2025

For the PR title, how about:

build(taskfile): Add tasks to run clang-tidy and to run non-C++ linting; Move C++ linting tasks into the clp-core build GH workflows.

@davidlion davidlion changed the title build(taskfile): Add tasks to run clang-tidy; Refactor existing C++ tasks; Add the new tasks to GH workflows. build(taskfile): Add tasks to run clang-tidy and to run non-C++ linting; Move C++ linting tasks into the clp-core build GH workflows. Mar 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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-tasks.yml (1)

171-765: Comprehensive Full Static Analysis for C++

The check-cpp-static-full task encompasses a complete clang-tidy run:

  • Setup: It references all C++ source files (*cpp_source_files) and depends on :core-generate, cpp-lint-configs, and venv.
  • Command: Uses :utils:cpp-lint:clang-tidy-find with detailed variables.
  • Exclusion Patterns:
    An extensive EXCLUDE_PATTERNS list is defined to skip files with known issues (e.g., circular includes in .inc files), which is crucial given the recurring errors in these files.
  • Additional Variables:
    The task specifies FLAGS, INCLUDE_PATTERNS, OUTPUT_DIR, ROOT_PATHS, and VENV_DIR to tie the analysis together.

Suggestions:

  • Maintainability: Consider alphabetising or categorising the EXCLUDE_PATTERNS list. This will ease future maintenance and readability.
  • Ongoing Review: As files are updated and underlying issues are resolved, update the exclusion list accordingly to gradually remove blacklisted files.

Overall, this segment is integral to realizing a robust full static analysis and appears comprehensive.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 653ad79 and c7df107.

📒 Files selected for processing (1)
  • lint-tasks.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: centos-stream-9-deps-image
  • GitHub Check: ubuntu-jammy-deps-image
  • GitHub Check: lint-check (ubuntu-latest)
🔇 Additional comments (11)
lint-tasks.yml (11)

4-4: New Variable Definition for Clang-Tidy Output Directory

The added variable G_LINT_CLANG_TIDY_DIR is well-defined as "{{.G_BUILD_DIR}}/lint-clang-tidy". This clearly designates the directory for clang-tidy outputs.


11-14: Refinement of the Unified Check Task

The check task now sequentially calls:

  • check-cpp-full
  • check-js
  • check-py
  • check-yaml

This modularisation aligns with the PR objectives to split and organise the linting workflows. Please verify that all upstream consumers of the old check-cpp task have been updated accordingly.


16-20: Implementation of the Diff-Based C++ Check

The check-cpp-diff task now integrates:

  • check-cpp-format
  • check-cpp-static-diff

This setup focuses on analysing only the changed C++ files. Ensure that the diff comparison uses the intended git reference (defaulting to origin/HEAD as per standard practice).


21-25: Full C++ Check Task Update

The check-cpp-full task now performs a complete check by sequentially running:

  • check-cpp-format
  • check-cpp-static-full

This change is consistent with the objective to perform a full analysis across all C++ files. Verify that the increased scope does not adversely impact performance in CI.


26-30: Separation of Non-C++ Linting Tasks

The introduction of the check-no-cpp task cleanly segregates JavaScript, Python, and YAML linting from C++ checks. This enhances clarity and avoids unintended invocation of clang-tidy when running non-C++ linting.


32-37: Updated Fix Task Composition

The fix task has been updated to call:

  • fix-cpp-full
  • fix-js
  • fix-py
  • fix-yaml

This redesign reflects the new structure of the linting workflows. It simplifies maintenance by unifying fixes across different languages.


39-43: Diff Fix Task for C++

The fix-cpp-diff task now correctly chains:

  • fix-cpp-format
  • fix-cpp-static-diff

This provides a targeted fix for only those files that have changed. The setup appears solid; please ensure that its integration with the corresponding diff-check task is verified.


44-48: Full Fix Task for C++

The fix-cpp-full task now executes:

  • fix-cpp-format
  • fix-cpp-static-full

This comprehensively addresses formatting and static analysis fixes across the entire C++ codebase. Verify that this approach meets the expected remediation in your workflows.


49-53: Non-C++ Fix Task Update

The fix-no-cpp task now delegates fixing to:

  • fix-js
  • fix-py
  • fix-yaml

This clear separation excludes C++ from non-related fixes, reducing the likelihood of cross-language side effects.


156-170: Static Diff Analysis for C++

The check-cpp-static-diff task is configured as follows:

  • Sources: Uses *cpp_source_files
  • Dependencies: :core-generate, cpp-lint-configs, and venv
  • Commands: Invokes :utils:cpp-lint:clang-tidy-diff with:
    • FLAGS (including --config-file and -p options),
    • OUTPUT_DIR set to {{.G_LINT_CLANG_TIDY_DIR}},
    • VENV_DIR defined as {{.G_LINT_VENV_DIR}}.

This configuration should accurately analyse only the changed files. Please double-check that the build directory specified in -p '{{.G_CORE_COMPONENT_BUILD_DIR}}' aligns with your environment settings.


840-840: Single Execution of Virtual Environment Setup

The directive run: "once" in the venv task guarantees that the environment setup is executed only a single time, preventing unnecessary redundancy in the build process.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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-tasks.yml (1)

171-765: Comprehensive “check-cpp-static-full” Task for Full Static Analysis

This newly added task is a major enhancement which:

  • Invokes a full clang‐tidy static analysis using the :utils:cpp-lint:clang-tidy-find task.
  • Specifies a detailed list of exclusion patterns to prevent false positives from files (e.g. due to circular includes or known problematic files).
  • Uses a consistent configuration with flags (pointing to {{.ROOT_DIR}}/.clang-tidy and using the build directory) and defines inclusion patterns for source and test files.

Recommendations:

  • The extensive blacklist under EXCLUDE_PATTERNS is crucial for avoiding known issues but may become unwieldy over time. Consider maintaining this list in a separate file or variable to improve readability and ease future updates.
  • Keep track of files removed from the exclusion list once issues are resolved.

Overall, this task is well configured to perform a robust static analysis across the entire C++ codebase.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c7df107 and 51de6b3.

📒 Files selected for processing (1)
  • lint-tasks.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: ubuntu-jammy-deps-image
  • GitHub Check: centos-stream-9-deps-image
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-14, true)
  • GitHub Check: lint-check (macos-latest)
🔇 Additional comments (11)
lint-tasks.yml (11)

4-4: New Clang-Tidy Output Directory Variable

A new variable, G_LINT_CLANG_TIDY_DIR, is defined to designate the directory where clang‐tidy results will be stored. This clarifies the output location for static analysis results and aligns with the integration of clang‐tidy in the lint tasks.


11-14: Updated “check” Task Commands

The check task now sequentially triggers the tasks:
• check-cpp-full
• check-js
• check-py
• check-yaml

This change refactors the previous C++ lint task to use the comprehensive C++ full check. The ordering appears alphabetical, which was previously suggested. Just ensure that any future additions continue to follow this convention.


16-19: Introduction of the “check-cpp-diff” Task

The newly added check-cpp-diff task combines both formatting and static analysis for C++ files that have changed compared to a given base reference. Please verify that the underlying tasks (check-cpp-format and check-cpp-static-diff) are correctly configured to operate on diffs.


21-24: New “check-cpp-full” Task Configuration

The check-cpp-full task invokes both C++ formatting and a full static analysis by running check-cpp-format and check-cpp-static-full. This appropriately encapsulates a complete C++ linting routine. Confirm that the full analysis provides all the diagnostics needed.


26-27: 'check-no-cpp' Task for Non‑C++ Linting

This task intentionally excludes C++ linting and runs only the JavaScript, Python, and YAML checks. This meets the PR’s objective to separate non‑C++ checks from the C++ linting tasks.


34-34: Updated “fix” Task

Within the fix task, the command now calls fix-cpp-full (instead of a deprecated or combined C++ fix) along with the other fix tasks. This change standardises the fix workflow to mirror the check tasks split.


39-43: New “fix-cpp-diff” Task Setup

The introduction of the fix-cpp-diff task, which runs both fix-cpp-format and fix-cpp-static-diff, aids in applying fixes only on changed C++ code. Be sure to test that the diff‑targeted fixes behave as expected.


44-48: Configuration for “fix-cpp-full” Task

The fix-cpp-full task now correctly sequences the C++ formatting and static full fixes by running fix-cpp-format followed by fix-cpp-static-full. This symmetry with the corresponding check task is beneficial for consistency; ensure that they remain in sync over time.


49-53: ‘fix-no-cpp’ Task for Non‑C++ Fixes

The fix-no-cpp task is designed to run fixes only for JavaScript, Python, and YAML. This separation follows the new design that omits C++ fixes from non‑C++ lint workflows.


156-170: New “check-cpp-static-diff” Task for Diff-Based Static Analysis

This task targets only the changed C++ files and applies clang‐tidy in diff mode. The flags and the output directory (G_LINT_CLANG_TIDY_DIR) are specified, and the build directory is passed using the -p flag. It is recommended to verify that the diff mode analysis produces the desired diagnostic output.


840-840: Optimisation in the “venv” Task

The addition of run: "once" ensures that the virtual environment setup happens only once per execution. This is a useful optimisation that should reduce unnecessary repeated initialisation.

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