Skip to content

✨ Analyser CLI #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

✨ Analyser CLI #11

wants to merge 28 commits into from

Conversation

juiwenchen
Copy link
Contributor

No description provided.

@juiwenchen juiwenchen changed the title Analyser cli ✨ Analyser CLI Aug 5, 2025
@juiwenchen juiwenchen requested a review from ubmarco August 5, 2025 12:00
@ubmarco
Copy link
Member

ubmarco commented Aug 5, 2025

Default for marker should be @need-ids:.
This should be documented. It will avoid the following surprise:

    "marker": "@",
    "need_ids": ["req-id:", "need_001", "need_002", "need_003", "need_004"]
  },

while it should be

    "marker": "@",
    "type": "need-id-refs",
    "need_ids": ["need_001", "need_002", "need_003", "need_004"]
  },

There a couple of use case of the analyzer and the downstream consumers do not know what use case is extracted.
Add this:

"type": "need-id-refs",

Use cases:

  • need-id-refs
  • need
  • rst

An example output json can look like:

[
  {
    "filepath": "tests/data/anchors/dummy_1.cpp",
    "remote_url": "https://github.com/useblocks/sphinx-codelinks/blob/f2d8d98ca10361663191c4c96255f39db9b5f518/tests/data/anchors/dummy_1.cpp#L3",
    "source_map": {
        "start": {
            "row": 10,
            "column": 3
        },
        "end": {
            "row": 13,
            "column": 16
        }
    },
    "marker": "@req-id:",
    "type": "need-id-refs",
    "need_ids": ["need_001", "need_002", "need_003", "need_004"]
  },
  {
    "filepath": "tests/data/anchors/dummy_1.cpp",
    "remote_url": "https://github.com/useblocks/sphinx-codelinks/blob/f2d8d98ca10361663191c4c96255f39db9b5f518/tests/data/anchors/dummy_1.cpp#L3",
    "source_map": {
        "start": {
            "row": 20,
            "column": 3
        },
        "end": {
            "row": 26,
            "column": 15
        }
    },
    "type": "need",
    "need": {
        "id": "TEST_001",
        "type": "test",
        "title": "Test a function"
    }
  },
  {
    "filepath": "tests/data/anchors/dummy_1.cpp",
    "remote_url": "https://github.com/useblocks/sphinx-codelinks/blob/f2d8d98ca10361663191c4c96255f39db9b5f518/tests/data/anchors/dummy_1.cpp#L3",
    "source_map": {
        "start": {
            "row": 30,
            "column": 3
        },
        "end": {
            "row": 35,
            "column": 15
        }
    },
    "type": "rst",
    "rst": "some paragraph with **bold** text and a \n\n.. test:: Test case\n   :id: TEST_002\n   This is a test case for the function.\n"
  }
]

ubmarco and others added 4 commits August 5, 2025 15:18
"tree-sitter-python>=0.23.6",
# Compiling issue on manylinux aarch64 image, so install from git instead of Pypi
# https://github.com/tree-sitter/py-tree-sitter/issues/386#issuecomment-3101430799
"tree-sitter @ git+https://github.com/tree-sitter/py-tree-sitter",
Copy link
Member

Choose a reason for hiding this comment

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

unpinned dependency, either pick a release or refer to a commit, document that clang is required due to this bug, also point out what's wrong.

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