feat(#2): aibolit integration#38
Conversation
|
@volodya-lombrozo could you take a look, please? |
README.md
Outdated
| - `--token, -t`: Token for the AI provider. | ||
| - `--debug, -d`: Enable debug logging. | ||
|
|
||
| Also, make sure you have [aibolit] installed. |
There was a problem hiding this comment.
@h1alexbel I believe it should be a supplementary tool, not a required one. In other words, refrax should work even without aibolit
There was a problem hiding this comment.
@volodya-lombrozo how about we introduce new parameter: --tools, that will signal which tool we should use for linting, aibolit or something else. WDYT?
internal/aibolit/aibolit.go
Outdated
| @@ -0,0 +1,5 @@ | |||
| package aibolit | |||
|
|
|||
| type Aibolit interface { | |||
There was a problem hiding this comment.
@h1alexbel aibolit is not the only way we can search flaws in the code. Actually, we can use plain linters, spell-checkers and so on. Thus, aibolit is just a tool that can be used by critic. What do you think if we rename this interface to Tool or Linter (or something else?) Then, the concrete implementation of it would be Aibolit instead of DefaultAibolit.
There was a problem hiding this comment.
@volodya-lombrozo agree, Tool is a good name for that
internal/client/refrax_client.go
Outdated
| // @todo #2:45min Implement support for Aibolit with multiple classes. | ||
| // As for now, we check only the first class, and return imperfections result. Instead, we need to support | ||
| // multiple files instead. Let's implement such Aibolit struct, that will be able to manage whole project, instead | ||
| // of single Java file. Also see this related issue: https://github.com/cqfn/refrax/issues/28. |
There was a problem hiding this comment.
@h1alexbel Maybe we need to place this todo in aibolit.go file? What do you think?
internal/critic/server.go
Outdated
| ` | ||
|
|
||
| func NewCritic(ai brain.Brain, port int) *Critic { | ||
| func NewCritic(ai brain.Brain, port int, aibolit aibolit.Aibolit) *Critic { |
There was a problem hiding this comment.
@h1alexbel Can we pass a variadic number of tools here? (e.g. tools ...tool)
internal/critic/server_test.go
Outdated
| "errors" | ||
| "testing" | ||
|
|
||
| "github.com/cqfn/refrax/internal/aibolit" |
There was a problem hiding this comment.
@h1alexbel What do you think if we put aibolit under the critic folder?
There was a problem hiding this comment.
@volodya-lombrozo indeed, it would be better
|
@volodya-lombrozo updated. Take a look, please |
volodya-lombrozo
left a comment
There was a problem hiding this comment.
@h1alexbel Looks good to me! Thank you for the contribution
In this PR I've implemented integration with aibolit, in order to supply critic with problems in the Java code, already found by
aibolit.closes #2