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

Allow lookup on URLs #316

Closed
wants to merge 6 commits into from
Closed

Allow lookup on URLs #316

wants to merge 6 commits into from

Conversation

dr0i
Copy link
Member

@dr0i dr0i commented Jun 23, 2023

Resolves #301.

Complies with metafacture-core.

  • increase max value of ClassDataAbstractionCoupling in checkstyle
  • implement test

Complies with metafacture-core.

- increase max value of ClassDataAbstractionCoupling in checkstyle
- implement test
Copy link
Member

@blackwinter blackwinter left a comment

Choose a reason for hiding this comment

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

First impression, not the final review...

In general, I'd really prefer variables to be kept final as much as possible. Could you please try to adapt your changes?

@@ -24,7 +24,9 @@
<module name="CatchParameterName">
<property name="format" value="^e$"/>
</module>
<module name="ClassDataAbstractionCoupling"/>
<module name="ClassDataAbstractionCoupling">
<property name="max" value="8"/>
Copy link
Member

Choose a reason for hiding this comment

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

That's one way to do it, sure. But then you should also review where this check has been disabled previously and whether these suppressions can be removed.

Alternatively, disable the check where it's failing now. We're going to review the whole Checkstyle configuration at some point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good advise - wasn't aware of that possibility. Disabled the check.

Copy link
Member

Choose a reason for hiding this comment

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

Disabled the check.

I'm not sure I understand. The ClassDataAbstractionCoupling is still enabled in Metafix.java. And the configuration change hasn't been reverted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, right, wasn't commited. Double checked the new PR #317.

if (path.startsWith(".")) {
if (fixFile != null) {
basePath = getPath(fixFile).getParent();
if (isValidUrl(path)) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not assign resolvedPath here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I followed your advice below to declare String resolvedPath; as final. That demands the use of path to not have an initialized variable.

Copy link
Member

Choose a reason for hiding this comment

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

That demands the use of path to not have an initialized variable.

Can you elaborate? There is no change w.r.t. the path variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot assign final String resolvedPath = path to use resolvedPath in if (isValidUrl(path)) {, right? Maybe I just don't understand what you meant here.

Comment on lines 86 to 87
urlPattern = WireMock.urlPathEqualTo(CSV_PATH);
responseBody = loadFile(CSV_PATH);
Copy link
Member

Choose a reason for hiding this comment

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

Why not give these variables appropriate names?

Copy link
Member Author

@dr0i dr0i Jun 26, 2023

Choose a reason for hiding this comment

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

OK. I've tried to do this , also not reusing Objects. I hope that was your intention here.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, thanks, that's what I had in mind. Although I don't understand this part:

also not reusing Objects.

Copy link
Member Author

Choose a reason for hiding this comment

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

In eef131a both objects urlPattern and responseBody where reused. That made the naming rather generic.

WIRE_MOCK_SERVER.stubFor(WireMock.get(urlPatternRedirectToUrl)
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "text/turtle")
.withBody(responseBody)));

//stub for CSV
Copy link
Member

Choose a reason for hiding this comment

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

Minor: Missing space after comment marker.

Copy link
Member Author

@dr0i dr0i Jun 26, 2023

Choose a reason for hiding this comment

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

Added a checkstyle rule an btw updated this dependency. This brought up some code commented out which I did in part just removed and in part left it (just "fixing" the structure the new checkstyle rule demands) as these comments may have some worth. I didn't find any remarks in git commits so I leave this to you to decide. Actually I don't know if you appreciate the new checkstyle rule at all or want to dump that.

Copy link
Member

Choose a reason for hiding this comment

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

Actually I don't know if you appreciate the new checkstyle rule at all or want to dump that.

In fact, I don't, sorry. Exactly because it can't differentiate between comments and commented-out code. Some things just have to be left to human judgement ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. Dumped that in #317.

@blackwinter blackwinter assigned dr0i and unassigned blackwinter Jun 23, 2023
dr0i added 5 commits June 26, 2023 15:43
- Check if a whitespace is followed when doing '//' comments
- update checkstyle dependency which is last java 8 compatible one
Following 316#pullrequestreview-1495514063.
@dr0i dr0i mentioned this pull request Jun 27, 2023
@dr0i
Copy link
Member Author

dr0i commented Jun 27, 2023

I opened new #317 to consolidate commits into one.

@dr0i dr0i assigned blackwinter and unassigned dr0i Jun 27, 2023
@blackwinter
Copy link
Member

Why am I assigned here? Is this PR superseded by #317 or not?

@dr0i
Copy link
Member Author

dr0i commented Jun 27, 2023

I assigned you because of some new comments from me here I though you may close by clicking on resolve conversation. But as you were fine with the superseding PR I close this.

@dr0i dr0i closed this Jun 27, 2023
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.

Allow urls with filemap
2 participants