-
Notifications
You must be signed in to change notification settings - Fork 39
Miq-Bot's Pronto Formatter #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
603e8f2
to
ad3f49a
Compare
GithubService.replace_comments(fq_repo_name, pr_number, rubocop_comments) do |old_comment| | ||
rubocop_comment?(old_comment) | ||
def versions | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to memoize this, otherwise, this will basically shell out for yamllint on every execution.
b47fa42
to
9bb0d9e
Compare
This pull request is not mergeable. Please rebase and repush. |
Integration of pronto required to add few new gems and to update some of the gems. The old method which provided the linter launching was reworked to launch pronto which provide the linter launching. The output of pronto is the result of all linters. The pronto result is transformed into a structure which match the original one. This integration required to change few tests and add new ones. Closes ManageIQ#192
Request in ManageIQ#406 to remove addition "column" information about the offence
Request in ManageIQ#406 to remove files in lib/linter/ which are not used
Variable "inspected_file_count" in the result of the linters has been removed due to missing use. It was not used in the pull request comment describing the offenses detected by linters in the source code.
Pronto runners (linters) expected to run will be automatically required in the CodeAnalysisMixin based on Gemfile specifications for pronto runners (linters).
Pronto is finally integrated into RubocopChecker worker. This RubocopChecker worker launchs pronto and pass the pronto output to a formatter whose result is posted as github pull request comment.
Checked commits europ/miq_bot@23a0369~...8c37984 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/workers/commit_monitor_handlers/commit_range/rubocop_checker.rb
app/workers/concerns/code_analysis_mixin.rb
spec/support/rubocop_spec_helper.rb
spec/workers/commit_monitor_handlers/commit_range/rubocop_checker_spec.rb
|
@miq-bot remove_label unmergeable |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation. |
Closing as we have some newer efforts for this, and also might not be going this direction since Edit: Err... guess I don't have the permissions to close... but we probably should. |
Dependency #406
The RubocopChecker worker will be universal for all linters - launching all linters via pronto and posting a comment to the pull request with the related offences. The fact that this worker is universal is related to the issue #245 where is a request for a change of class name of this worker to
ProntoWorker
orLinterWorker
.The RubocopChecker worker will run the Pronto Runners obtaining their result as an array of Pronto::Message objects which are parsed by
Miq-Bot's Formatter
which creates a human readable pull request comment. This comment with an appropriate header describing the linter versions and runner version is posted to the pull request as an pull request comment.The
Miq-Bot's Formatter
is a function whose input is always an array of Pronto::Message objects which does not matter on the linter or runner type. The array contain unified results of launched linters via runners which is passed to the formatting function. The results of launched linters inside of this function are converted into a plain text in a human readable format describing the detected offences in the pull request.The hyperlinks in the comment refers to the last commit with the related file or related line in file.
Examples
Everything looks fine.

Some offences have been detected.

\cc
@skateman
@Fryguy