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

added validation check for default params to nf-core lint #830

Merged
merged 8 commits into from
Jan 25, 2021

Conversation

KevinMenden
Copy link
Contributor

Simply added a jsonschema validation check to the schema_lint.py function check.

So the steps are now to:

  • load the schema
  • get schema defaults
  • check for correct format as before
  • then validate the default params against the schema itself

The AssertionError was exchanged with an Exception because we capture two different errors now.
Will probably make this more finegrained.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@codecov
Copy link

codecov bot commented Jan 15, 2021

Codecov Report

Merging #830 (58a6d1d) into dev (be0a144) will decrease coverage by 0.03%.
The diff coverage is 72.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #830      +/-   ##
==========================================
- Coverage   77.72%   77.68%   -0.04%     
==========================================
  Files          22       22              
  Lines        2496     2514      +18     
==========================================
+ Hits         1940     1953      +13     
- Misses        556      561       +5     
Impacted Files Coverage Δ
nf_core/schema.py 86.47% <70.58%> (-0.84%) ⬇️
nf_core/lint/schema_lint.py 81.81% <100.00%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be0a144...58a6d1d. Read the comment docs.

@KevinMenden KevinMenden marked this pull request as ready for review January 18, 2021 11:51
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Man, I managed to come up with loads of comments for quite a small PR - sorry! 😓

Overall it looks fine and I'm sure works great, just all OCD niggles 🤓

nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
KevinMenden and others added 2 commits January 18, 2021 14:56
Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
@KevinMenden
Copy link
Contributor Author

Alright applied all the changes - thanks for the review! Hopefully I manage to make the reviews easier for you soon 😁

Apart from that there's still the question whether we should just put all of that code into the schema class?

@ewels
Copy link
Member

ewels commented Jan 22, 2021

Looking great! Yes I think we should move it to the schema class if that's ok..

@KevinMenden
Copy link
Contributor Author

Sure, no problem. I also think that might be nicer :-)
Will refactor then.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

So nearly there 😆 Need to run now sorry else I would have done this change and merged as it's so small. But yeah, hopefully makes sense and basically looks 💯

CHANGELOG.md Outdated Show resolved Hide resolved
nf_core/schema.py Outdated Show resolved Hide resolved
nf_core/schema.py Outdated Show resolved Hide resolved
nf_core/lint/schema_lint.py Outdated Show resolved Hide resolved
@KevinMenden KevinMenden merged commit 19db9cb into nf-core:dev Jan 25, 2021
@KevinMenden KevinMenden deleted the schmema-lint branch January 25, 2021 14:54
@ewels
Copy link
Member

ewels commented Jan 25, 2021

Awesome, thanks for putting up with my pedantic requests @KevinMenden! 😆

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.

Validate nextflow_schema.json that parameter type matches actual value
2 participants