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

nf-core bump-version breaks linting #1265

Closed
d4straub opened this issue Aug 27, 2021 · 2 comments · Fixed by #1438
Closed

nf-core bump-version breaks linting #1265

d4straub opened this issue Aug 27, 2021 · 2 comments · Fixed by #1438
Labels
bug Something isn't working low-priority
Milestone

Comments

@d4straub
Copy link
Contributor

d4straub commented Aug 27, 2021

Description of the bug

nf-core bump-version removes the last newline in nextflow.config and therefore breaks linting, I had to correct that for ampliseq and bacass after bumping the version.

Steps to reproduce

Steps to reproduce the behaviour:

nf-core bump-version
results: nf-core linting on github EditorConfig will fail with

$ editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
nextflow.config:
	Wrong line endings or new final newline
1 errors found

Version

nf-core/tools version 2.1

@d4straub d4straub added the bug Something isn't working label Aug 27, 2021
@ewels
Copy link
Member

ewels commented Dec 9, 2021

I don't really understand how this can happen 🤔 We do a regex find + replace for a specific string (that is not at the end of the file). Is Python really messing with the newlines just from opening and resaving a file?

@ewels ewels added this to the 2.3 milestone Dec 9, 2021
@ewels ewels changed the title "nf-core bump-version" breaks linting nf-core bump-version breaks linting Dec 9, 2021
@drpatelh drpatelh modified the milestones: 2.4, 2.3 Mar 8, 2022
ewels added a commit to ewels/nf-core-tools that referenced this issue Mar 14, 2022
@ewels
Copy link
Member

ewels commented Mar 14, 2022

Tested and replicated the error. It's my fault, it's because the code splits the file into an array of lines and then joins them with a newline. This means that the trailing newline is removed.

Fixed in #1438

@ewels ewels linked a pull request Mar 14, 2022 that will close this issue
4 tasks
@ewels ewels closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants