Skip to content

Add linter for DOI type citation.#484

Merged
jmchilton merged 4 commits intogalaxyproject:masterfrom
mvdbeek:doi_linter
May 24, 2016
Merged

Add linter for DOI type citation.#484
jmchilton merged 4 commits intogalaxyproject:masterfrom
mvdbeek:doi_linter

Conversation

@mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented May 20, 2016

I guess this is useful on its own, and may prove more valuable if we support plugging tool information from http://bio.tools into planemo tool_init.

@jmchilton
Copy link
Member

Very nice - I love this!

@mvdbeek
Copy link
Member Author

mvdbeek commented May 20, 2016

Thanks @jmchilton - seems like I created a false positive in the tests though

@@ -0,0 +1,31 @@
<tool id="copy" name="Copy Dataset" version="1.0">
<description>copies a dataset</description>
Copy link
Member

Choose a reason for hiding this comment

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

The test framework just ensures all fail_ tools fail linting - just rename to invaild_doi or something and the failing test will work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, indeed, that did the trick, thanks!

Improve parsing of doi citation tag from xml, use lint_ctx.warn in case of
unexpected response from dx.doi and uppercase Galaxy (thanks @nsoranzo).
self._check_exit_code(lint_cmd, exit_code=0)

def test_lint_doi(self):
fail_doi = os.path.join(TEST_TOOLS_DIR, "invalid.xml_doi.xml")
Copy link
Member

Choose a reason for hiding this comment

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

s/invalid.xml_doi.xml/invalid_doi.xml/ ?

@jmchilton jmchilton merged commit b4852bb into galaxyproject:master May 24, 2016
@jmchilton
Copy link
Member

Awesome thanks!

r = requests.get(url)
if r.status_code == 200:
if publication_id != doiless_publication_id:
lint_ctx.error("%s is valid, but Galaxy expects DOI without 'doi:' prefix" % publication_id)
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure about this? @bgruening pointed out in galaxyproject/tools-iuc#768 (comment) that the initial 'doi:' seems to work fine.

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 just tested it again, the doi breaks the display of the reference with my terribly out-of-date planemo instance (September 2015 I believe), but newer galaxy can deal with the doi:. I guess we could tone this down to an info?

Copy link
Member

Choose a reason for hiding this comment

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

Something like:

lint_ctx.warn("%s is valid, but old Galaxy versions expected DOI without 'doi:' prefix" % publication_id)

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes ... but given those old instances will disappear over time, maybe we can remove the warning altogether? Alternatively we should at least figure out how old is old :/

Copy link
Member

Choose a reason for hiding this comment

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

Up to you or @jmchilton, I don't have a strong opinion on this.

Copy link
Member

Choose a reason for hiding this comment

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

I have no clue what changed to enable those - I just rewalked through the code and I can't even figure out why it works at all with the leading doi: - I don't think it should. Anyway - I definitely consider a leading doi: a tool bug and on a purely stylistic point somewhat redundant given the citation type is "doi". I think warn is entirely appropriate here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants