Skip to content

[IMP] Add tabs nesting check for RST#17190

Open
nikibrown wants to merge 1 commit into17.0from
17.0-make-review-tabs-update-nikbr
Open

[IMP] Add tabs nesting check for RST#17190
nikibrown wants to merge 1 commit into17.0from
17.0-make-review-tabs-update-nikbr

Conversation

@nikibrown
Copy link
Copy Markdown
Contributor

Task: https://www.odoo.com/odoo/project/3835/tasks/6083413

Issue:

Forgetting a parent .. tab:: in a group of tabs causes make fast issues
image

Solution:
Add checker to detect incorrect nesting in tabs

Testing:
Edit an RST file with tabs example: content/applications/marketing/events/event_reporting/attendees_report.rst and delete .. tabs:: on line 22

Run make fast and reproduce errors

Run make review on content/applications/marketing/events/event_reporting/attendees_report.rst

Expected output should be:

Enter relative content path: content/applications/marketing/events/event_reporting/attendees_report.rst 
Enter max line length (default: 100): 
content/applications/marketing/events/event_reporting/attendees_report.rst:24: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)
content/applications/marketing/events/event_reporting/attendees_report.rst:42: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)
content/applications/marketing/events/event_reporting/attendees_report.rst:58: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)
content/applications/marketing/events/event_reporting/attendees_report.rst:78: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)
content/applications/marketing/events/event_reporting/attendees_report.rst:94: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)
make: *** [review] Error 1

Re-add parent .. tab:: and run make review. Expected output should be: No problems found.

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented Mar 31, 2026

Pull request status dashboard

@nikibrown nikibrown changed the title Add tabs nesting check for RST Mar 31, 2026
@nikibrown nikibrown force-pushed the 17.0-make-review-tabs-update-nikbr branch from 76e3559 to 7fa6fbf Compare March 31, 2026 19:21
@nikibrown nikibrown changed the title IMP] Add tabs nesting check for RST Mar 31, 2026
@C3POdoo C3POdoo requested a review from a team March 31, 2026 19:24
Copy link
Copy Markdown
Contributor

@theRealThagomizer theRealThagomizer left a comment

Choose a reason for hiding this comment

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

Hiya, @nikibrown! I got the same failstates as yesterday with a handy error message in make review. Here's what I did.

  1. Opened content/applications/sales/crm/performance/expected_revenue_report.rst and deleted .. tabs:: at line 138 (I couldn't find the file at the path you suggested so I went digging for another one with tabs in it.)
  2. Ran make clean/make fast. Make fast failed. Error follows:
    `waiting for workers...

Traceback (most recent call last):
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/application.py", line 344, in build
self.builder.build_update()
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/builders/init.py", line 294, in build_update
self.build(to_build,
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/builders/init.py", line 308, in build
updated_docnames = set(self.read())
^^^^^^^^^^^
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/builders/init.py", line 413, in read
self._read_parallel(docnames, nproc=self.app.parallel)
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/builders/init.py", line 464, in _read_parallel
tasks.join()
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/util/parallel.py", line 108, in join
if not self._join_one():
^^^^^^^^^^^^^^^^
File "/home/odoo/github/odoo/.venv/lib/python3.12/site-packages/sphinx/util/parallel.py", line 129, in _join_one
raise SphinxParallelError(*result)
sphinx.errors.SphinxParallelError: KeyError: 'tabs_stack'

Sphinx parallel build error:
KeyError: 'tabs_stack'
make: *** [Makefile:61: html] Error 2`

  1. Ran make review on same file. Errors follow:
    content/applications/sales/crm/performance/expected_revenue_report.rst:57: consider moving "Type" to line 57 (early-line-breaks) content/applications/sales/crm/performance/expected_revenue_report.rst:65: consider moving "filter." to line 65 (early-line-breaks) content/applications/sales/crm/performance/expected_revenue_report.rst:207: consider moving ":guilabel:➖" to line 207 (early-line-breaks) content/applications/sales/crm/performance/expected_revenue_report.rst:139: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting) content/applications/sales/crm/performance/expected_revenue_report.rst:163: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting) content/applications/sales/crm/performance/expected_revenue_report.rst:188: tab directive must be nested under .. tabs:: (indent it under a parent .. tabs:: block) (tabs-directive-nesting)

Seems like it's functioning as you intended? If so, you've got my approval!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants