Skip to content
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

Take over the junit-formatter? #7686

Closed
coding-bunny opened this issue Feb 5, 2020 · 8 comments · Fixed by #7701
Closed

Take over the junit-formatter? #7686

coding-bunny opened this issue Feb 5, 2020 · 8 comments · Fixed by #7701
Labels

Comments

@coding-bunny
Copy link

Is your feature request related to a problem? Please describe.

CI systems such as CircleCI are limited in what kind of output formats they are able to parse. For RuboCop, the only parseable format they support at the moment is the JUnit XML format, which was originally done through the rubocop-junit-formatter gem

This gem however is no longer being maintained and has been archived on GitHub.

Describe the solution you'd like

Since the project is under the MIT license, I'd like to suggest that the RuboCop team forks and takes over the maintenance for this gem, making it an officially supported formatter for the project, allowing better integration with CircleCI systems

Describe alternatives you've considered

The archived repository recommends to use gems like Pronto. This however is quite an elaborate setup that needs to be done in order to get the desired output formatting.

Additional context

We run CircleCI ourselves for the majority of our projects like RuboCop does, and having any errors reported being easily readable in the test-result overview increases productivity.
I'd be more than happy to help maintain the gem if it's being taken over.

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 6, 2020

@coding-bunny That's fine by me, although I'm wondering if transferring the original repo is an option. We also have to consider the RubyGems deployment and a potential change to the name. Have you spoken with its author? // cc @mikian

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 6, 2020

P.S. I took a look at the code and its so simple that we can potentially just add this as a built-in formatter in RuboCop itself.

@mikian
Copy link

mikian commented Feb 6, 2020

@coding-bunny I still would argue that running rubocop as part of CI tests is not best approach, as I see coding style issues more of Pull Request comments and part of workflow than failing tests (think hot fixes... sometimes we need to push ugly code to save the world). I did quickly look through CircleCI environment variables and running pronto with it should be as simple as adding pronto and pronto-rubocop to Gemfile, and then just running PRONTO_PULL_REQUEST_ID=${CIRCLE_PR_NUMBER} pronto run -f github_pr_review (naturally setting PRONTO_GITHUB_ACCESS_TOKEN to appropriate GitHub access token).
That said, I can see that some workflows do not use pull requests, do not prefer getting style issues as PR comments or are not using GitHub, could benefit running rubocop with JUnit formatter.
@coding-bunny if you want to take maintainer role of existing gem - I'm more than happy to unarchive it and give you necessary rights to maintain it. Only reason why I archived it was that I do not use it personally anymore, do not have much time to spare for it and unfortunately PR quality I got was not in par of the code I would be willing to publish and did not had time to implement requested features and/or cleaning PR code (we are talking global $ variables here level code - which is funny as this gem is for rubocop...). Let me know if you are interested of this.
@bbatsov This really is simple formatter and simple code, if you think it makes more sense to be built-in formatter, I am more than happy to move code around and create PR for it.

@coding-bunny
Copy link
Author

@mikian : We have no choice, we use a custom implementation with plugins for RuboCop that cannot be run over CodeClimate, hence why we run it over our CI to ensure our code is correct. Also I don't agree with that vision you posted, nor am I open to discussing our reasons for that. The main reason is that we rely on the rubocop-junit-formatter and we would like to see the maintenance for this gem continue or similar support being added to RuboCop.

@coding-bunny
Copy link
Author

As for being a maintainer, more than happy to keep it going/alive if that is the desired approach compared to moving it into RuboCop itself. I'm more than happy to support either way, but that decision needs to be made by either you or the RuboCop team.

@koic
Copy link
Member

koic commented Feb 6, 2020

I've trying on this formatter into RuboCop core since yesterday. I will be able to open a PR to RuboCop core when I have finished writing the test code and documentation.

@mikian
Copy link

mikian commented Feb 6, 2020

@coding-bunny To correct to avoid any misunderstandings, I was talking about pronto that literally runs same rubocop with same rules and custom code than you would normally run. It has nothing to do with CodeClimate. I do think that most of use cases where JUnit formatter is used would be better handled with PR comments, but as said, I understand this doesn't work for most people and I am not arguing of your possible reasoning - the usual way of fixing problem is usually just making problem go away completely :)
@koic Ah perfect, this definitely is the best solution for everyone.

@koic
Copy link
Member

koic commented Feb 9, 2020

I opened the PR #7701.

koic added a commit to koic/rubocop that referenced this issue Feb 10, 2020
Fixes rubocop#7686.

This PR Adds new `JUnitFormatter` formatter based on rubocop-junit-formatter gem.
https://github.com/mikian/rubocop-junit-formatter

And this PR includes the following patch to implementation of `JUnitFormatter`.
mikian/rubocop-junit-formatter#11.

REXML gem has been bundled gem since Ruby 2.8.0-dev (Ruby 3.0), it is
added to depend on gemspec.

- https://bugs.ruby-lang.org/issues/16485
- ruby/ruby@c3ccf23
bbatsov pushed a commit that referenced this issue Feb 10, 2020
Fixes #7686.

This PR Adds new `JUnitFormatter` formatter based on rubocop-junit-formatter gem.
https://github.com/mikian/rubocop-junit-formatter

And this PR includes the following patch to implementation of `JUnitFormatter`.
mikian/rubocop-junit-formatter#11.

REXML gem has been bundled gem since Ruby 2.8.0-dev (Ruby 3.0), it is
added to depend on gemspec.

- https://bugs.ruby-lang.org/issues/16485
- ruby/ruby@c3ccf23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants