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

WIP Feature/reek extended support #283

Closed

Conversation

bergholdt
Copy link

Work In Progress - need tests

This PR makes it possible to use Reek from version 1.3.4 up to current 4.1.0. and fixes Issue #272

I still need to figure out how to make automated test, but I have verified it manually running against metric_fu repo.

I wellcome any help on the test 😊

@@ -8,21 +10,18 @@ def emit
files = files_to_analyze
if files.empty?
mf_log "Skipping Reek, no files found to analyze"
@output = run!([], config_files)
run!([], config_files)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was @output being used anywhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@output was used in analyze where the result from reek is passed to metric_fu structure.

This output content differ between reek versions and therefore requires different parsing to same metric_fu structure.

I moved this parsing and into different ReekExaminer classes, the ReekExaminer.get method will create proper parser depending on Reek gem version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried creating specs by making yaml fixtures storing the content of @output from the different major Reek versions (1,2,3,4).

But I fail deserialising them because I need the proper Reek classes for that version. I think I might need to serialise it to basic data types..but then I should implement the parser to work on this (meaning that we need to convert it to basic data on normal run as well)

So any suggestions on how I can verify the parsing of the Reek data structure?

ps: will push my work in progress specs as pending

@bf4
Copy link
Member

bf4 commented Sep 26, 2016

When I was last working on MetricFu it was in preparation for a breaking change to solidify the metrics interface so that each metric could be implemented for whatever version of whatever metric gem you want. This is sort of what CodeClimate did with its engines spec, but I never got that far. I bring this up, since you are encountering those same maintenance stresses that got me thinking about how to make maintenance easier. On the plus side, this got me involved in discussions with other projects and thinking more about usability.. but.. might be time for a breaking change

@jkeam
Copy link
Member

jkeam commented Sep 27, 2016

I think as long as we respect semver, breaking changes are ok :)
Esp for something like what you are suggestion. A nice standard interface would be pretty awesome.

@mvz
Copy link

mvz commented Oct 11, 2016

Hi, I'm one of the Reek maintainers, and I strongly recommend only supporting Reek 4.x, since that is the first version that follows semver and has a defined API.

@mvz
Copy link

mvz commented Oct 11, 2016

Also, if you have any questions, don't hesitate to ask. I would really like to get metric_fu to support an up-to-date version of Reek, since currently it is essentially broken for me. I'd submit a pull request, but it seems there are already two of them outstanding, so I thought I'd first help sort out the versioning issues.

@bergholdt bergholdt force-pushed the feature/reek-extended-support branch from e988636 to ac54433 Compare March 18, 2018 22:29
@etagwerker
Copy link
Member

etagwerker commented Apr 29, 2020

@bergholdt Thanks for submitting this! Would it be possible for you to solve the conflicts here?

Travis CI is now passing (✅), so I'd like to see if your changes still work. Also, #306 will bump the version of reek which might break these changes.

@bergholdt
Copy link
Author

@etagwerker merged changes from master - so there is no more conflict.
I Admit I have not used metrics_fu for for a long time and do not remember the changes I made on this PR.

Perhaps it would be best to simply close this and create a new that only supports the newest Reek

@etagwerker
Copy link
Member

@bergholdt I think that is a good idea. Thank you!

@etagwerker etagwerker closed this Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants