Add doctest and tests for clearcode coordinate helpers

Open Beginner friendly
#861 0 comments 0 reactions 0 assignees View on GitHub

@drawliin is already working on this.

Since Mar 28, 2026.

  • #862 by @drawliin — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
testing-qa

Research direction

Read clearcode/cdutils.py, especially str2coord() and its TODO, then inspect clearcode/tests/test_sync.py. Add doctest examples for cd URLs, URNs, and plain paths; add URL/URN parsing coverage and coord2str namespace handling tests, and confirm the test suite passes.

Written by the indexing model from the issue text.

Description

While reading clearcode/cdutils.py, I noticed that str2coord() still has a TODO for adding a doctest.

This helper parses ClearlyDefined coordinates from multiple input formats such as:

  • cd:/... URLs
  • urn:... strings
  • plain coordinate paths

Proposed changes:

  • add doctest examples to str2coord()
  • add tests covering URL and URN parsing in the existing clearcode/tests/test_sync.py
  • add a small test for coord2str() to verify namespace handling

Files involved:

  • clearcode/cdutils.py
  • clearcode/tests/test_sync.py
Dominant language
HTML
Stars
70
Forks
76
Avg merge
23m
Merged PRs (30d)
2

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/purldb

All issues in aboutcode-org/purldb

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.