phptools-docs
phptools-docs copied to clipboard
Formatter: Option to ignore section or line or entire file
Description
The option to ignore sections or lines or entire file from the formatter would be very useful. As you know, there is no universal method of formatting everything, so exclusion can help sometimes. This would also solve the problem of potentially erroneous formatting, which can happen with complex weird files. What do you think?
Describe the solution you'd like
Maybe something like in Stylelint eg.:
/* stylelint-disable */
a {}
/* stylelint-enable */
Or like in phpcs:
<?php
// phpcs:ignoreFile
public function store($myArray) // phpcs:ignore
// @codingStandardsIgnoreStart
class MyClassTest extends \PHPUnit_Framework_TestCase
{
// @codingStandardsIgnoreEnd
// ...
}
Hello,
This feature is available in the latest pre-release. Please take a look and let me know how it goes ;-)
The comments are: // @php-format off // @php-format on
or you can use any other comment type, the text is important.
Thank you
Hi, Thank you for the quick implementation Did some quick tests. At first glance, it works fine
I only have doubts about the formatting of the line with the comment - details in the video below:
The comment tags worked great for me; however, I still need a single line ignore for certain complex statements (for example in a function argument) where two wrapping comments isn't ideal