Browse Source

DX: Travis - check for trailing spaces

Dariusz Ruminski 8 years ago
parent
commit
416403662c

+ 1 - 0
.travis.yml

@@ -75,6 +75,7 @@ install:
 
 script:
     - if [ $TASK_SCA == 1 ]; then php php-cs-fixer fix --rules declare_strict_types -q; fi
+    - if [ $TASK_SCA == 1 ]; then files_with_trailing_spaces=`find . -type f -not -path "./.git/*" -not -path "./vendor/*" -not -path "./tests/Fixtures/*" -exec egrep -l " $" {} \;` && [[ $files_with_trailing_spaces ]] && echo $files_with_trailing_spaces && travis_terminate 1 || echo "No trailing spaces detected."; fi
 
     - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose; fi
     - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi

+ 2 - 2
README.rst

@@ -124,8 +124,8 @@ problems as possible on a given file or files in a given directory and its subdi
     $ php php-cs-fixer.phar fix /path/to/dir
     $ php php-cs-fixer.phar fix /path/to/file
 
-By default ``--path-mode`` is set to ``override``, which means, that if you specify the path to a file or a directory via 
-command arguments, then the paths provided to a ``Finder`` in config file will be ignored. You can use ``--path-mode=intersection`` 
+By default ``--path-mode`` is set to ``override``, which means, that if you specify the path to a file or a directory via
+command arguments, then the paths provided to a ``Finder`` in config file will be ignored. You can use ``--path-mode=intersection``
 to merge paths from the config file and from the argument:
 
 .. code-block:: bash

+ 2 - 2
src/Console/Command/FixCommandHelp.php

@@ -40,8 +40,8 @@ problems as possible on a given file or files in a given directory and its subdi
     <info>$ php %command.full_name% /path/to/dir</info>
     <info>$ php %command.full_name% /path/to/file</info>
 
-By default <comment>--path-mode</comment> is set to ``override``, which means, that if you specify the path to a file or a directory via 
-command arguments, then the paths provided to a ``Finder`` in config file will be ignored. You can use <comment>--path-mode=intersection</comment> 
+By default <comment>--path-mode</comment> is set to ``override``, which means, that if you specify the path to a file or a directory via
+command arguments, then the paths provided to a ``Finder`` in config file will be ignored. You can use <comment>--path-mode=intersection</comment>
 to merge paths from the config file and from the argument:
 
     <info>$ php %command.full_name% --path-mode=intersection /path/to/dir</info>

+ 5 - 5
src/Fixer/Basic/BracesFixer.php

@@ -54,11 +54,11 @@ final class BracesFixer extends AbstractFixer implements WhitespacesAwareFixerIn
 class Foo {
     public function bar($baz) {
         if ($baz = 900) echo "Hello!";
-        
+
         if ($baz = 9000)
             echo "Wait!";
-            
-        if ($baz == true) 
+
+        if ($baz == true)
         {
             echo "Why?";
         }
@@ -66,8 +66,8 @@ class Foo {
         {
             echo "Ha?";
         }
-        
-        if (is_array($baz)) 
+
+        if (is_array($baz))
             foreach ($baz as $b)
             {
                 echo $b;

+ 6 - 6
src/Fixer/ClassNotation/ClassDefinitionFixer.php

@@ -107,7 +107,7 @@ class  Foo  extends  Bar  implements  Baz,  BarBaz
                 new VersionSpecificCodeSample(
 '<?php
 
-trait  Foo  
+trait  Foo
 {
 }',
                     new VersionSpecification(50400)
@@ -130,8 +130,8 @@ $foo = new  class  extends  Bar  implements  Baz,  BarBaz {};
                 new CodeSample(
 '<?php
 
-class Foo 
-extends Bar 
+class Foo
+extends Bar
 implements Baz, BarBaz
 {}
 ',
@@ -140,8 +140,8 @@ implements Baz, BarBaz
                 new CodeSample(
 '<?php
 
-class Foo 
-extends Bar 
+class Foo
+extends Bar
 implements Baz
 {}
 ',
@@ -150,7 +150,7 @@ implements Baz
                 new CodeSample(
 '<?php
 
-interface Bar extends 
+interface Bar extends
     Bar, BarBaz, FooBarBaz
 {}
 ',

+ 1 - 1
src/Fixer/ClassNotation/ProtectedToPrivateFixer.php

@@ -60,7 +60,7 @@ final class ProtectedToPrivateFixer extends AbstractFixer
 final class Sample
 {
     protected $a;
-    
+
     protected function test()
     {
     }

+ 1 - 1
src/Fixer/ClassNotation/SelfAccessorFixer.php

@@ -63,7 +63,7 @@ class Sample
 {
     const BAZ = 1;
     const BAR = Sample::BAZ;
-    
+
     public function getBar()
     {
         return Sample::BAR;

+ 1 - 1
src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php

@@ -52,7 +52,7 @@ final class ClassKeywordRemoveFixer extends AbstractFixer
 
 use Foo\Bar\Baz;
 
-$className = Baz::class; 
+$className = Baz::class;
 ',
                     new VersionSpecification(50500)
                 ),

+ 1 - 1
src/Fixer/Phpdoc/PhpdocInlineTagFixer.php

@@ -76,7 +76,7 @@ final class PhpdocInlineTagFixer extends AbstractFixer
 /**
  * @{TUTORIAL}
  * {{ @link }}
- * {@examples} 
+ * {@examples}
  * @inheritdocs
  */
 '

+ 6 - 6
src/Fixer/Whitespace/NoExtraConsecutiveBlankLinesFixer.php

@@ -182,7 +182,7 @@ switch ($foo) {
     case 41:
         echo "foo";
         break;
-        
+
     case 42:
         break;
 }',
@@ -231,7 +231,7 @@ $foo = array(
                 new CodeSample(
 '<?php
 
-function foo($bar) 
+function foo($bar)
 {
     return $bar;
 
@@ -252,7 +252,7 @@ $foo = [
                 new CodeSample(
 '<?php
 
-function foo($bar) 
+function foo($bar)
 {
     throw new \Exception("Hello!");
 
@@ -262,7 +262,7 @@ function foo($bar)
                 new CodeSample(
 '<?php
 
-function foo($bar) 
+function foo($bar)
 {
     throw new \Exception("Hello!");
 
@@ -286,10 +286,10 @@ class Bar
                 new CodeSample(
 '<?php
 
-class Foo 
+class Foo
 {
     use Bar;
-    
+
     use Baz;
 }',
                     array('useTrait')

Some files were not shown because too many files changed in this diff