Consider enforcing line feeds in .gitattributes
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- git
- Domain
- developer-experience
Research direction
Review the repository's .gitattributes file and Git's line-ending behavior, especially with core.autocrlf enabled. Update the attributes so checked-out text files consistently use LF, then verify the file change and confirm that the configuration covers the affected Python scripts.
Written by the indexing model from the issue text.
Description
Description of feature
Enforce line feeds in .gitattributes using settings such as
* text eol=lf
to prevent corruption by core.autocrlf settings.
Background
I recently ran into an edge case likely caused by a misconfigured core.autocrlf setting in git while running nf-core/mag (see the original issue here: https://github.com/nf-core/mag/issues/1050). This caused line endings in a python script to be converted to CRLF in the working tree when nextflow pulled the pipeline (apparently the global git settings apply to nextflow pulls). If the pipeline is run with the apptainer profile (although this might apply to other profiles as well), this corrupts the shebang #!/usr/bin/env python and causes the apptainer to crash. Manual CRLF to LF conversion in the cached repository using dos2unix fixed this issue.
Settings in the .gitattributes file can be used to overrule core.autocrlf to force git (and by extension nextflow) to checkout to LF line endings, preventing this issue.
While this is an edge case, I do not see a scenario in which forced LF line endings would cause issues and therefore request the .gitattributes file be changed accordingly.
- Dominant language
- Python
- Stars
- 322
- Forks
- 255
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nf-core/tools
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug good-first-issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100