Skip to content

Handle library paths with spaces#487

Merged
brondani merged 1 commit into
mainfrom
handle-library-paths-spaces
Jun 25, 2026
Merged

Handle library paths with spaces#487
brondani merged 1 commit into
mainfrom
handle-library-paths-spaces

Conversation

@brondani

@brondani brondani commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Changes

  • Add quotes to library paths when it contains spaces
  • Add test cases

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@qltysh

qltysh Bot commented Jun 25, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.31%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: B Coverage rating: B
pkg/maker/buildcontent.go80.0%392, 410-411
Total80.0%
🤖 Increase coverage with AI coding...
In the `handle-library-paths-spaces` branch, add test coverage for this new code:

- `pkg/maker/buildcontent.go` -- Lines 392 and 410-411

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  6 files  ±0   18 suites  ±0   4s ⏱️ +3s
110 tests +1  110 ✅ +1  0 💤 ±0  0 ❌ ±0 
660 runs  +6  660 ✅ +6  0 💤 ±0  0 ❌ ±0 

Results for commit e621d83. ± Comparison against base commit 99ccdb9.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CMake generation logic to correctly handle library paths containing spaces by quoting affected target_link_libraries(...) entries, and adds test coverage plus fixture data to validate the behavior.

Changes:

  • Quote target_link_libraries entries that contain spaces during CMake content generation.
  • Add a unit test covering mixed quoted/unquoted library entries with/without spaces and varying indentation.
  • Extend test fixtures to include a library file whose filename contains a space and update the expected generated CMakeLists.txt.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/data/solutions/blanks/ref/project X.AC6 X+ARMCM0 X/CMakeLists.txt Updates expected CMake output to include a quoted library path containing spaces.
test/data/solutions/blanks/project/project X.cproject.yml Adds a library file with a space in its filename to the project input fixture.
test/data/solutions/blanks/project/project X.AC6 X+ARMCM0 X.cbuild.yml Adds the space-containing library file as a library category input fixture.
test/data/solutions/blanks/project/libr ary.a Adds a dummy library file fixture whose filename includes a space.
pkg/maker/buildcontent.go Introduces quoteEntry and applies it when emitting target_link_libraries entries.
pkg/maker/buildcontent_test.go Adds a unit test validating quoting behavior for library entries with spaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brondani brondani marked this pull request as ready for review June 25, 2026 09:06
@brondani brondani requested a review from soumeh01 June 25, 2026 09:07
@brondani brondani merged commit ddd935c into main Jun 25, 2026
26 checks passed
@brondani brondani deleted the handle-library-paths-spaces branch June 25, 2026 09:32
@brondani brondani moved this from In review to Done in CMSIS-Toolbox 2.1x Jun 25, 2026
@brondani brondani moved this from Done to In review in CMSIS-Toolbox 2.1x Jun 25, 2026
@brondani brondani self-assigned this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants