Skip to content

#814 - PHPCS should not test deleted files + fix the last 2 files in error with phpcs

Fabrice Gangler requested to merge phpcs_fix into develop
  • Fixed #814 (closed) - PHPCS should not test deleted files
  • exclude vendor assets: jquery, bootstrap, ...
  • exclude 1 rule for "base.css" file
  • fix the last 2 files in error with phpcs
  • update documenation

Now all source code passes without phpcs errors.


For #814 (closed), added an option to fail quickly :

# Quickly fail: script stopped at the 1st file that do not pass the tests
bin/COMPTOIR_phpcs_on_last_commit.sh -q  -c bcb227bc2a -d <path> 

	run ---> vendor/bin/phpcs --report=full tests/Fixture/TaxonomysFixture.php

	FILE: <path>/tests/Fixture/TaxonomysFixture.php
	--------------------------------------------------------------------------------------------------------
	FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
	--------------------------------------------------------------------------------------------------------
	 47 | WARNING | Line exceeds 120 characters; contains 154 characters
	    |         | (Generic.Files.LineLength.TooLong)
	--------------------------------------------------------------------------------------------------------
# Longer processing time: all files (modified in the last commit) are tested
bin/COMPTOIR_phpcs_on_last_commit.sh     -c bcb227bc2a -d <path> 

	run ---> vendor/bin/phpcs --report=full tests/Fixture/TaxonomysFixture.php
	no run ---> deleted file: tests/TestCase/Model/Table/LicensesTableTest.php
	no run ---> deleted file: tests/TestCase/Model/Table/ReviewsTableTest.php
	no run ---> deleted file: tests/TestCase/Model/Table/UsersTableTest.php
	run ---> vendor/bin/phpcs --report=full webroot/index.php

	FILE: <path>/tests/Fixture/TaxonomysFixture.php
	--------------------------------------------------------------------------------------------------------
	FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
	--------------------------------------------------------------------------------------------------------
	 47 | WARNING | Line exceeds 120 characters; contains 154 characters
	    |         | (Generic.Files.LineLength.TooLong)
	--------------------------------------------------------------------------------------------------------


	FILE: <path>/webroot/index.php
	----------------------------------------------------------------------------------------------------------------------------
	FOUND 3 ERRORS AND 1 WARNING AFFECTING 1 LINE
	----------------------------------------------------------------------------------------------------------------------------
	 27 | ERROR   | [x] Each PHP statement must be on a line by itself
	    |         |     (Generic.Formatting.DisallowMultipleStatements.SameLine)
	 27 | ERROR   | [x] Each PHP statement must be on a line by itself
	    |         |     (Generic.Formatting.DisallowMultipleStatements.SameLine)
	 27 | WARNING | [ ] Line exceeds 120 characters; contains 204 characters (Generic.Files.LineLength.TooLong)
	 27 | ERROR   | [x] Each PHP statement must be on a line by itself
	    |         |     (Generic.Formatting.DisallowMultipleStatements.SameLine)
	----------------------------------------------------------------------------------------------------------------------------
	PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
	----------------------------------------------------------------------------------------------------------------------------
Edited by Fabrice Gangler

Merge request reports