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

Add specific prettier-commit config for prettier check, improve log message #2100

Merged
merged 6 commits into from
Dec 7, 2022

Conversation

mashehu
Copy link
Contributor

@mashehu mashehu commented Dec 7, 2022

Probably preferred to #2099.

Not sure that is the best way to handle the stdout from pre-commit, which is a bit confusing when you don't know that we run pre-commit. It just removes:

  prettier.................................................................Failed
 - hook id: prettier
 - files were modified by this hook

Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

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

LGTM

When I test it, pre-commit always modifies modules.json, I am wondering if we have different configuration files for prettier, one that wants

"installed_by": [
    "modules"
] 

and one that wants "installed_by": ["modules"] 🤔

@mirpedrol
Copy link
Member

I am wondering if we have different configuration files for prettier

Answering to myself, it's the module.json dumper who prints the wrong format every time 😓 so nothing to do with prettier.

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #2100 (a80adbb) into dev (f0b6c48) will decrease coverage by 0.04%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##              dev    #2100      +/-   ##
==========================================
- Coverage   68.01%   67.97%   -0.05%     
==========================================
  Files          43       43              
  Lines        5625     5630       +5     
==========================================
+ Hits         3826     3827       +1     
- Misses       1799     1803       +4     
Impacted Files Coverage Δ
nf_core/lint_utils.py 78.72% <50.00%> (-7.00%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

Nice! Agreed, much preferable to #2099

nf_core/lint_utils.py Outdated Show resolved Hide resolved
@mashehu
Copy link
Contributor Author

mashehu commented Dec 7, 2022

I am wondering if we have different configuration files for prettier

Answering to myself, it's the module.json dumper who prints the wrong format every time 😓 so nothing to do with prettier.

This should have been fixed by #2074, no?

Co-authored-by: Phil Ewels <phil.ewels@scilifelab.se>
@mirpedrol
Copy link
Member

This should have been fixed by #2074, no?

Yes it is :) prettier is run on this file to fix it, this is why I was getting the message The following files were modified by prettier... every time.

@mashehu
Copy link
Contributor Author

mashehu commented Dec 7, 2022

oh, yes, that makes sense! Will be solved by having it as log.debug now.

@ewels
Copy link
Member

ewels commented Dec 7, 2022

I wasn't able to break it 👍🏻

@ewels
Copy link
Member

ewels commented Dec 7, 2022

(and I tried really quite hard)

@ewels ewels merged commit c9d46e8 into nf-core:dev Dec 7, 2022
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.

3 participants