mediacurrent / theme_generator_8

Yeoman generator for Drupal Themes - lets you quickly set up a Drupal 8 theme with sensible defaults and best practices.
MIT License
100 stars 24 forks source link

Mix of line-endings in generated files #75

Closed Tregonia closed 2 years ago

Tregonia commented 4 years ago

Found an issue where the default output theme has linter issues from the initial load.

Running coding standards tests for custom profiles.
Running PHP lint for custom profiles.
Running coding standards tests for custom themes.
FILE: .../web/themes/custom/theme/theme.libraries.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 1 | WARNING | File has mixed line endings; this may cause incorrect
   |         | results
----------------------------------------------------------------------

Reviewing the files, just opening and resaving the file cleaned up the issues. Here is a git diff of the change

diff --git a/web/themes/custom/theme/theme.libraries.yml b/web/themes/custom/theme/theme.libraries.yml
index 6ca0464..dda76f5 100644
--- a/web/themes/custom/theme/theme.libraries.yml
+++ b/web/themes/custom/theme/theme.libraries.yml
@@ -28,7 +28,7 @@ global:
 #   dependencies:
 #     - theme/clearfix
 #     - theme/visually-hidden
-
+
 accordion:
   css:
     component:
@@ -38,22 +38,22 @@ accordion:
   dependencies:
     - core/drupal
     - core/jquery
-
+
 button:
   css:
     component:
       dist/css/button.css: {}
-
+
 card:
   css:
     component:
       dist/css/card.css: {}
-
+
 card-list:
   css:
     component:
       dist/css/card-list.css: {}
-
+
 carousel:
   css:
     component:
@@ -64,37 +64,37 @@ carousel:
     - core/drupal
     - core/jquery
     - theme/slick-carousel
-
+
 eyebrow:
   css:
     component:
       dist/css/eyebrow.css: {}
-
+
 heading:
   css:
     component:
       dist/css/heading.css: {}
-
+
 hero:
   css:
     component:
       dist/css/hero.css: {}
-
+
 media-item:
   css:
     component:
       dist/css/media-item.css: {}
-
+
 message:
   css:
     component:
       dist/css/message.css: {}
-
+
 tabs:
   css:
     component:
       dist/css/tabs.css: {}
-
+
 slick-carousel:
   css:
     component:
Tregonia commented 4 years ago

This is also possibly happening in the .gitignore file.

diff --git a/web/themes/custom/theme/.gitignore b/web/themes/custom/theme/.gitignore
index adac14d..d3533d2 100644
--- a/web/themes/custom/theme/.gitignore
+++ b/web/themes/custom/theme/.gitignore
@@ -25,4 +25,3 @@ dist/js/*
 # Ignore Patternlab files that change every time.
 patternlab
 dependencyGraph.json
-
mariohernandez commented 3 years ago

Hey @Tregonia what would your recommendation be to address these issues? Is it normal for developers to run PHP linting tests in a theme?

damienmckenna commented 2 years ago

All files that are generated are expected to use UNIX line endings. This can be fixed by running the "dos2unix" command (or equivalent) on the text files in this codebase.

damienmckenna commented 2 years ago

I think this problem has been resolved since it was originally opened, I don't see this with the current codebase.