Active
Project:
Coder
Version:
8.x-2.x-dev
Component:
Review/Rules
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 May 2017 at 20:40 UTC
Updated:
12 Feb 2018 at 23:30 UTC
Jump to comment: Most recent
See #2831598: Two SVG icons have crlf line endings, where a couple of the SVG files that make up Drupal 8.x core were found to have CRLF (Windows-style) line endings. In particular, see comment #4, which references directions for setting up .gitconfig to correct CRLF line endings. If they can be auto-corrected on upload (or just rejected with a notice to fix the issue on the user side) this should prevent the issue from re-occurring. Note that, if the d.o. repository system already follows the practices outlined in https://www.drupal.org/node/1542048 (as it should, presumably), there may be some tweaks needed (and that documentation may need to be corrected or updated).
Comments
Comment #2
lomo commentedComment #3
lomo commentedComment #4
lomo commentedMaybe this can be closed as the .svg was addressed with a simple change to the d8 .gitattributes file. But maybe it would also be possible to check any patch (for any kind of file, including any new file types that might not yet be addressed by the .gitattributes) for CRLF line endings (and let the person uploading said patch fix the files in question).
Comment #5
dddave commentedComment #6
drummI don’t think this would make sense as a Git restriction. If I’m mirroring a repository to Drupal.org, I don’t want commits blocked, forcing me to make divergent history. Or if I were a developer treating an SVG as a binary-ish file, I don’t care much about the line endings inside.
I could see adding code sniffs for detecting bad line endings.
This also made me think of a code sniff for scripts embedded in SVG. SVGs can have inline JS, which we rarely want in a Drupal project. A sniff would help maintainers spot that if they are treating SVGs as binary-ish.
Comment #7
MixologicDrupalci just runs the rules provided to it, which are in the coder module. Moving.