Skip to content

Bug - Markdown report throws error when all checks passΒ #5058

@PeterDekkers

Description

@PeterDekkers

Observed behaviour

When using the --ghmarkdown option to generate a Markdown report, and when all checks pass, an UnboundLocalError is thrown.

There is a previous issue which was accidentally closed: #5053

β–Ά fontbakery check-opentype fonts/otf/Fraunces9pt-Black.otf --ghmarkdown otf-opentype-checks.md  
Start ... running 53 individual check executions.

β–“ [PSPPPPPSPPPPPPPPSSSSSSSPPPPPSPPPPPSPSPPSPPPSSSSSSSSSP] 100%
Total:
    ERROR: 0
    FATAL: 0
    FAIL: 0
    WARN: 0
    INFO: 0
    SKIP: 22
    PASS: 31



    Meaning of check results:

    An ERROR is something wrong with FontBakery itself, possibly a bug.
    A  FATAL is an extremely severe issue that must be addressed immediately.
    A  FAIL is a problem with the font that must be fixed.
    A  WARN is something that you should consider addressing.
    An INFO result simply prints something useful. Typically stats.
    A  PASS means the font looks good for the given checking routine.
And a  SKIP happens when the check does not apply to the given font.

    If you get ERRORs, please help us improve the tool by reporting them at
    https://github.com/fonttools/fontbakery/issues (but other kinds of bug
    reports and/or feature requests are also always welcome, of course!)




                           ,@.
                         ,@.@@,.
                   ,@@,.@@@.  @.@@@,.
                 ,@@. @@@.     @@. @@,.
         ,@@@.@,.@.              @.  @@@@,.@.@@,.
    ,@@.@.     @@.@@.            @,.    .@’ @’  @@,
  ,@@. @.          .@@.@@@.  @@’                  @,
 ,@.  @@.                                          @,
 @.     @,@@,.     ,                             .@@,
 @,.       .@,@@,.         .@@,.  ,       .@@,  @, @,
 @.                             .@. @ @@,.    ,      @
  @,.@@.     @,.      @@,.      @.           @,.    @’
   @@||@,.  @’@,.       @@,.  @@ @,.        @’@@,  @’
      \\@@@@’  @,.      @’@@@@’   @@,.   @@@’ //@@@’
       |||||||| @@,.  @@’ |||||||  |@@@|@||  ||
        \\\\\\\  ||@@@||  |||||||  |||||||  //
         |||||||  ||||||  ||||||   ||||||  ||
          \\\\\\  ||||||  ||||||  ||||||  //
           ||||||  |||||  |||||   |||||  ||
            \\\\\  |||||  |||||  |||||  //
             |||||  ||||  |||||  ||||  ||
              \\\\  ||||  ||||  ||||  //
               ||||||||||||||||||||||||

         No check is failing. Get a cupcake!
       <<Art by Tony de Marco, July 26, 2018>>

DONE!
Traceback (most recent call last):
  File "/Users/stephennixon/type-repos/00-client-type-repos/Fraunces/venv/bin/fontbakery", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/stephennixon/type-repos/00-client-type-repos/Fraunces/venv/lib/python3.11/site-packages/fontbakery/cli.py", line 520, in main
    reporter.write()
  File "/Users/stephennixon/type-repos/00-client-type-repos/Fraunces/venv/lib/python3.11/site-packages/fontbakery/reporters/serialize.py", line 57, in write
    fh.write(self.template(self.getdoc()))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/stephennixon/type-repos/00-client-type-repos/Fraunces/venv/lib/python3.11/site-packages/fontbakery/reporters/ghmarkdown.py", line 119, in template
    total=num_checks,
          ^^^^^^^^^^
UnboundLocalError: cannot access local variable 'deprecation_warning' where it is not associated with a value

Expected behaviour

No error should be thrown.

Resources and steps needed to reproduce

See #5053

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions