🐛 Handle id_required for src-trace#35
Merged
Merged
Conversation
ubmarco
requested changes
Sep 23, 2025
Member
There was a problem hiding this comment.
Can you make this optional, so if users do not provide the ID, you calculate it yourself from the project/directory/file (replace all non-identifier chars with _). Or calculate a short hash from it, just like SN does. Something reproducible with the same inputs.
That ID information will presumably not be helpful because why would people link to the src-trace directive itself?
But if we want src-trace to be a dedicated need, then we should do that. Forcing users to set IDs that will not be useful is meeh.
A src-trace for the same combination of project, directory, and file cannot exist in a Sphinx project because that leads to duplicate needs.
See also #15 (comment)
57714cb to
b0f8a08
Compare
ubmarco
requested changes
Sep 25, 2025
ubmarco
reviewed
Sep 25, 2025
Co-authored-by: Marco Heinemann <marco.heinemann@useblocks.com>
ubmarco
approved these changes
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues
#23
#15
Summary
Based on the issues, adapt the directive
src-traceto haveidfield, so that the configid_required=Truedoes not block the need generation. This adaptation react to needs configid_from_titleandid_lengthImplementation
idis optional and when it's not given, the hash is always generated fromtitileandproject. Ifdirectoryorfileis given, it's taken as well.id_required