Skip to content

[Beginner]: Add src/sdk/tests to the CI clang-format lint matrix #1301

@rwalworth

Description

@rwalworth

🐥 Beginner Friendly

This issue is a great fit for contributors who are ready to explore the Hiero C++ codebase a little more and take on slightly more independent work.

Beginner Issues often involve reading existing C++ code, understanding how different parts of the SDK fit together, and making small, thoughtful updates that follow established patterns.

The goal is to support skill growth while keeping the experience approachable, well-scoped, and enjoyable.


👾 Description of the Issue

The CI lint job uses clang-format 17 to enforce formatting standards, but it only covers two source paths:

src/sdk/main
src/tck

Relevant file:

.github/workflows/zxc-build-library.yaml

The src/sdk/tests directory — which contains all SDK unit and integration tests — is not included. This means test files can silently diverge from the project's formatting standards with no automated enforcement. Keeping test code formatted consistently matters: it makes diffs easier to read and review, and it reinforces the habit of formatting all code before pushing.


💡 Proposed Solution

Add a third entry to the lint job's matrix in .github/workflows/zxc-build-library.yaml:

- type: tests
  check-path: "src/sdk/tests"

This follows the exact same pattern already used for sdk and tck. Before the matrix entry can be added, any existing formatting violations in src/sdk/tests must be fixed so that the new lint job passes from the start.


👩‍💻 Implementation Steps

  • Read the lint job in .github/workflows/zxc-build-library.yaml to understand the existing matrix structure (look at the strategy.matrix.include section)
  • Install clang-format 17 locally if you have not already (see docs/training/workflow.md section 6)
  • Run clang-format in dry-run mode against the test directory to identify any existing formatting violations:
    find src/sdk/tests -name "*.cc" -o -name "*.h" | xargs clang-format-17 --dry-run --Werror
  • Fix any violations by running clang-format in-place:
    find src/sdk/tests -name "*.cc" -o -name "*.h" | xargs clang-format-17 -i
  • Add the third matrix entry to the lint job in .github/workflows/zxc-build-library.yaml:
    - type: tests
      check-path: "src/sdk/tests"
  • Build the SDK and confirm all existing tests still pass
  • Open a pull request; confirm the new Lint (tests) CI job passes

✅ Acceptance Criteria

  • Scope: Changes are limited to .github/workflows/zxc-build-library.yaml and any test source files with formatting violations
  • Behavior: No SDK logic or public API changes
  • CI: The new Lint (tests) matrix job passes on the pull request
  • Review: All code review feedback addressed

📋 Step-by-Step Contribution Guide

  • Comment /assign to request the issue
  • Wait for assignment
  • Fork the repository and create a branch
  • Set up the project using the instructions in README.md
  • Make the requested changes
  • Sign each commit using -s -S
  • Push your branch and open a pull request

Read Workflow Guide for step-by-step workflow guidance. Read README.md for setup instructions.

❗ Pull requests cannot be merged without S and s signed commits. See the Signing Guide.


🤔 Additional Information

Reference files to read:

  • .github/workflows/zxc-build-library.yaml — the file being updated; focus on the lint job
  • .clang-format — the formatting config used by clang-format when no explicit style is given

If you have questions while working on this issue, feel free to ask! Hiero-SDK-C++ Discord

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: refactorCode changes that neither fix a bug nor add a featurepriority: lowNon-urgent tasks, nice-to-have improvements, or minor issuesskill: beginnerSuitable for contributors who have completed a good first issue and want to build skillsstatus: ready for devThe issue is fully defined and ready for a contributor

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions