Skip to content

bug: griffe check --format=github should imply no-color #378

@edgarrmondragon

Description

@edgarrmondragon

Description of the bug

The workflow annotation title that's generated for the github format option currently contains ANSI codes which causes a bit of an ugly rendering in the GitHub UI:

Image

This goes away if you use the --no-color flag:

Image

but I think the default should be to not include those ANSI codes in the GitHub output.

To Reproduce

I'm too lazy to set up a repo just for this 😅 , but you can check these links

Full traceback

NA

Expected behavior

The same output as with --no-color.

Environment information

NA

Additional context

It seems that the style applied to the location is the culprit, but I only did a quick search of the code:

griffe/src/_griffe/diff.py

Lines 148 to 149 in 5930e0b

def _format_location(self) -> str:
return f"{Style.BRIGHT}{self._location}{Style.RESET_ALL}:{self._lineno}"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions