-
Notifications
You must be signed in to change notification settings - Fork 71
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
Allow to specify a part separator other than dot "." #1159
base: master
Are you sure you want to change the base?
Conversation
With this patch you can refer to :need:`A5.1`. Before this patch: Traceback (most recent call last): File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/cmd/build.py", line 298, in build_main app.build(args.force_all, args.filenames) File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/application.py", line 351, in build self.builder.build_all() File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 252, in build_all self.build(None, summary=__('all source files'), method='all') File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/builders/__init__.py", line 363, in build self.write(docnames, list(updated_docnames), method) File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/builders/latex/__init__.py", line 299, in write doctree = self.assemble_doctree( File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/builders/latex/__init__.py", line 365, in assemble_doctree self.env.resolve_references(largetree, indexfile, self) File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/environment/__init__.py", line 676, in resolve_references self.apply_post_transforms(doctree, fromdocname) File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/environment/__init__.py", line 693, in apply_post_transforms self.events.emit('doctree-resolved', doctree, docname) File "/home/nn/.local/pipx/venvs/sphinx/lib/python3.10/site-packages/sphinx/events.py", line 97, in emit results.append(listener.handler(self.app, *args)) File "/home/nn/code/github.com/holmboe/sphinx-needs/sphinx_needs/needs.py", line 350, in process_caller check_func(app, doctree, fromdocname, current_nodes[check_node]) File "/home/nn/code/github.com/holmboe/sphinx-needs/sphinx_needs/roles/need_ref.py", line 95, in process_need_ref dict_need["title"] = target_need["parts"][need_id_part]["content"] KeyError: '1' > /home/nn/code/github.com/holmboe/sphinx-needs/sphinx_needs/roles/need_ref.py(95)process_need_ref() -> dict_need["title"] = target_need["parts"][need_id_part]["content"]
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1159 +/- ##
=======================================
Coverage 85.92% 85.92%
=======================================
Files 56 56
Lines 6536 6538 +2
=======================================
+ Hits 5616 5618 +2
Misses 920 920
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I have studied the code further and have identified a few more places where it would require changes for the config option Thoughts? |
heya thanks, yeh I'm not against it in principle, but indeed would require a good look (and testing) to make sure it is working as expected 👍 |
I like the idea, but I'm afraid that this change is a tough one, as So the next step should be to have 2-3 additional test cases, which are changing the seperator and tests, if filtering, needflows and co. are all working. |
Yes I can see that this is hard-coded in various places. I am motivated to dig through the code to find them out. However, I would be greatly helped if someone who is more intimately knowledgeable of the roles/directives/whatnot could create some test cases that is marked |
Note to self: this is likely helped by and related to |
This (partly?) solves #1160.
With this patch you can refer to a need containing a dot, an example:
Before this patch: