Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: displaying number of checked files #6674

Merged
merged 7 commits into from Nov 5, 2022
Merged

minor: displaying number of checked files #6674

merged 7 commits into from Nov 5, 2022

Conversation

krzysztofrewak
Copy link
Contributor

I refactored a little PhpCsFixer\Console\Report\FixReport\TextReporter and PhpCsFixer\Console\Report\FixReport\ReportSummary with number of checked files. I think this is more verbose:

Checked 18 files in 0.272 seconds, 16.000 MB memory used

than current implementation:

Checked all files in 0.272 seconds, 16.000 MB memory used

I wonder if these changes should be applied to Json/Xml reporters as well?

I also updated Docker Composer override file, because provided syntax was invalid.

Copy link
Member

@julienfalque julienfalque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change!

src/Console/Report/FixReport/TextReporter.php Outdated Show resolved Hide resolved
src/Console/Command/FixCommand.php Outdated Show resolved Hide resolved
src/Console/Report/FixReport/TextReporter.php Outdated Show resolved Hide resolved
tests/Console/Report/FixReport/TextReporterTest.php Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 3, 2022

Pull Request Test Coverage Report for Build 3388557666

  • 13 of 14 (92.86%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 92.919%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Console/Command/FixCommand.php 0 1 0.0%
Totals Coverage Status
Change from base Build 3365138575: -0.002%
Covered Lines: 17281
Relevant Lines: 18598

💛 - Coveralls

@krzysztofrewak
Copy link
Contributor Author

@julienfalque, how to understand this test failure? https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/actions/runs/3380683950/jobs/5621742409

1) PhpCsFixer\Tests\Smoke\StdinTest::testFixingStdin
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
       ----------- end diff -----------
 
 
-Found 1 of 1 files that can be fixed in 0.010 seconds, 14.000 MB memory used
+Found 1 of 1 files that can be fixed in 0.011 seconds, 14.000 MB memory used
 '

I ran it locally twice and get two different results in the same environment:

krzysztof@blumilk:~/dev/PHP-CS-Fixer$ dcr php-7.4 ./vendor/bin/phpunit --filter testFixingStdin tests/Smoke/StdinTest.php 
Creating php-cs-fixer_php-7.4_run ... done
PHPUnit 9.5.26 by Sebastian Bergmann and contributors.


Error:         PHP extension pcntl is required for enforcing time limits
Testing PhpCsFixer\Tests\Smoke\StdinTest
F                                                                                                                                                                                                                                                                                                           1 / 1 (100%)

Time: 00:00.209, Memory: 16.00 MB

There was 1 failure:

1) PhpCsFixer\Tests\Smoke\StdinTest::testFixingStdin
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
       ----------- end diff -----------
 
 
-Found 1 of 1 files that can be fixed in 0.010 seconds, 16.000 MB memory used
+Found 1 of 1 files that can be fixed in 0.009 seconds, 16.000 MB memory used
 '

/app/tests/Smoke/StdinTest.php:71
phpvfscomposer:///app/vendor/phpunit/phpunit/phpunit:97

FAILURES!
Tests: 1, Assertions: 3, Failures: 1.
ERROR: 1
krzysztof@blumilk:~/dev/PHP-CS-Fixer$ dcr php-7.4 ./vendor/bin/phpunit --filter testFixingStdin tests/Smoke/StdinTest.php 
Creating php-cs-fixer_php-7.4_run ... done
PHPUnit 9.5.26 by Sebastian Bergmann and contributors.


Error:         PHP extension pcntl is required for enforcing time limits
Testing PhpCsFixer\Tests\Smoke\StdinTest
.                                                                                                                                                                                                                                                                                                           1 / 1 (100%)

Time: 00:00.204, Memory: 16.00 MB

OK (1 test, 3 assertions)

Should StdinTest:69 be rewritten from assertSame to some regex test? Maybe it should be done in next PR?

tests/Smoke/StdinTest.php Outdated Show resolved Hide resolved
@julienfalque julienfalque merged commit b577444 into PHP-CS-Fixer:master Nov 5, 2022
@julienfalque
Copy link
Member

Thank you @krzysztofrewak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants