src-d / style-analyzer

Lookout Style Analyzer: fixing code formatting and typos during code reviews
GNU Affero General Public License v3.0
32 stars 21 forks source link

Add GitHub suggestion comments generation #709

Closed EgorBu closed 5 years ago

EgorBu commented 5 years ago

Now it's possible to generate comments like:

## Example output 1 Possible typos in `Token_Taken_Tuken`, suggestions: Candidate 1 with confidence 33% ```suggestion var Token_Tokens_Tokens; ``` Candidate 2 with confidence 33% ```suggestion var Token_Tokens_Then; ``` Candidate 3 with confidence 32% ```suggestion var Token_Tokens_Token; ``` ## Example output 2 Possible typos in `someWrang_Variuble_NOME`, suggestions: Candidate 1 with confidence 33% ```suggestion var someRange_Variable_NODE = "bla"; ``` Candidate 2 with confidence 33% ```suggestion var someWrap_Variable_NODE = "bla"; ``` Candidate 3 with confidence 33% ```suggestion var someLang_Variable_NODE = "bla"; ``` ## Example output 3 Possible typos in `some_wrang_variuble_nome`, suggestions: Candidate 1 with confidence 33% ```suggestion var some_range_variable_node = "bla"; ``` Candidate 2 with confidence 33% ```suggestion var some_wrap_variable_node = "bla"; ``` Candidate 3 with confidence 33% ```suggestion var some_lang_variable_node = "bla"; ```

Signed-off-by: egor egor@sourced.tech

EgorBu commented 5 years ago
commit 9683f33fec085533738dc839731405aae846e7f6 (origin/add-token, add-token)
Author: Irina <irenekhismatullina@gmail.com>
Date:   Wed Mar 20 18:08:27 2019 +0300

    Adjust analyzer to show the token proba, if present

    Signed-off-by: Irina <irenekhismatullina@gmail.com>

commit c1b45efb0ea1dbabcbdf713974dfa91b6da5017c
Author: Irina <irenekhismatullina@gmail.com>
Date:   Wed Mar 20 17:58:56 2019 +0300

    Always add token to candidates

    Signed-off-by: Irina <irenekhismatullina@gmail.com>

Couple of commits breaks the logic - ~waiting for updates from @irinakhismatullina to rebase.~ new model solves the problem.

EgorBu commented 5 years ago

Test added

zurk commented 5 years ago

@vmarkovtsev let's merge?