Browse Source

Merge "Improve warning details"

Zuul 7 months ago
parent
commit
6106a9051f
1 changed files with 10 additions and 6 deletions
  1. 10
    6
      zuul_sphinx/zuul.py

+ 10
- 6
zuul_sphinx/zuul.py View File

@@ -491,15 +491,17 @@ class ZuulAutoJobsDirective(ZuulDirective):
491 491
     has_content = False
492 492
 
493 493
     def run(self):
494
-        lines = []
494
+        env = self.state.document.settings.env
495 495
         names = set()
496 496
         for job in self.zuul_layout.jobs:
497 497
             name = job['name']
498 498
             if name in names:
499 499
                 continue
500
-            lines.extend(self.generate_zuul_job_content(name))
500
+            lines = self.generate_zuul_job_content(name)
501
+            location = 'Job "%s" included in %s' % \
502
+                (name, env.doc2path(env.docname))
503
+            self.state_machine.insert_input(lines, location)
501 504
             names.add(name)
502
-        self.state_machine.insert_input(lines, self.zuul_layout_path)
503 505
         return []
504 506
 
505 507
 class ZuulAutoProjectTemplateDirective(ZuulDirective):
@@ -514,15 +516,17 @@ class ZuulAutoProjectTemplatesDirective(ZuulDirective):
514 516
     has_content = False
515 517
 
516 518
     def run(self):
517
-        lines = []
519
+        env = self.state.document.settings.env
518 520
         names = set()
519 521
         for template in self.zuul_layout.project_templates:
520 522
             name = template.name
521 523
             if name in names:
522 524
                 continue
523
-            lines.extend(self.generate_zuul_project_template_content(name))
525
+            lines = self.generate_zuul_project_template_content(name)
526
+            location = 'Template "%s" included in %s' % \
527
+                (name, env.doc2path(env.docname))
528
+            self.state_machine.insert_input(lines, location)
524 529
             names.add(name)
525
-        self.state_machine.insert_input(lines, self.zuul_layout_path)
526 530
         return []
527 531
 
528 532
 

Loading…
Cancel
Save