• 
      

    Add review bot tool for uncrustify formatting

    Review Request #9664 — Created Feb. 17, 2018 and discarded

    Information

    ReviewBot
    release-1.0.x

    Reviewers

    This review bot tool will check if all files are
    correctly formatted. Otherwise it will print
    a unified diff as an issue to show the formatting
    problem.

    Created a review request with incorrect formatting
    and saw that the bot marks the correct lines.

    Description From Last Updated

    E126 continuation line over-indented for hanging indent

    reviewbotreviewbot

    E126 continuation line over-indented for hanging indent

    reviewbotreviewbot
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    misery
    1. 
        
    2. Work in progress...

      How to use a "ChoiceField" for "uncrustify, astyle and clang-format" if only some tools are installed and checked by check_dependencies?

      Also... this works with "Comment on unmodified code" only. Looks like Review._is_modified needs to adjusted here. But how?

      1. Works with "Comment on unmodified code" now. But not on "whitespaces changes only" stuff as RB means that it is not "modified".

    3. 
        
    misery
    Review request changed
    Commit:
    e492095c4a99fbef5991ccac46b2e3f7e0fa061b
    e71a21a9f62c294da603ba54489733df4fc900ac

    Checks run (1 failed, 1 succeeded)

    flake8 failed.
    JSHint passed.

    flake8

    misery
    misery
    misery
    misery
    david
    1. Instead of including the diffs as comments, how about making it show the "new" version only?

      Something like:


      Formatting is incorrect. Use:

      new code here
      

      1. Well, nice idea.... but I don't know how to do it with the diffs.

      2. The @@ lines in the diff contain information about where each differing section starts, and how many lines it covers. You could parse the diff only for those and then pull the relevant lines out of the formatted file.

      3. Thanks, tried it. But it looks weird if there are whitespace-only changes. Remove lines only, Add lines only, or just an identation won't show what to do here as it will not show spaces/tabs correctly.
        Maybe an option to let the user select "show as unified diff"? So it can be added later.

    2. 
        
    misery
    Review request changed
    Status:
    Discarded
    Change Summary:

    https://github.com/misery/ExtendedBots