Skip to content

Timings script should highlight slow lint rules #57765

Open
@srawlins

Description

@srawlins

I think we could colorize the expanded output (behind a flag?):

/Users/srawlins/code/dart-linter/foo/lib/src/foo/dir/x.dart 1:8 [lint] Document all public members.
String addddddd() => 'yay';
       ^^^^^^^^

1 file analyzed, 1 issue found, in 6472 ms.

Maybe colorize the text being indicated red? addddddd? Or make it bold?

And the --stats output, as part of this TODO:

https://github.com/dart-lang/linter/blob/a088573c6628935a634d642d0863b7fd58b106a6/lib/src/formatter.dart#L96

we could also colorize/shame slow linter rules

------------------------------------------------------
Timings                                             ms
------------------------------------------------------
public_member_api_docs                             180
invariant_booleans                                   7
directives_ordering                                  4
non_constant_identifier_names                        2
file_names                                           1
test_types_in_equals                                 0
------------------------------------------------------
Total                                               32
------------------------------------------------------

Would it be acceptable to add a dependency on ansicolor and start with minimal colors (my two examples)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagetype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions