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

Add trace of the error when debug verbosity #1023

Merged
merged 16 commits into from Aug 21, 2023

Conversation

kylekatarnls
Copy link
Member

@kylekatarnls kylekatarnls commented Aug 20, 2023

Type: feature
Breaking change: no

  • --error-file - send errors (other than reported violations) output to a file; default to STDERR

Allow to record error in a file (consistently with what is possible for report now with --report-file)

Handle deprecation and error consistently. Both inside Command instead of error in Command and deprecation directly output by CommandLineOptions (which shouldn't be the responsibility of CommandLineOptions IMO).

Show error stack trace when using debug verbosity.

Add few tests for Command and CommandLineOptions

Run tests coverage with PHP 8.2 and xdebug (we had phpdbg for performance reasons, but this is no longer an issue with xdebug 3, also phpdbg struggles to properly mark coverage in switch statements, so let's move back to xdebug and align workflows with PDepend ones)

@kylekatarnls kylekatarnls force-pushed the feature/error-details-output branch 6 times, most recently from 431f25c to a15115e Compare August 20, 2023 15:27
@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.87% 🎉

Comparison is base (208f850) 89.50% compared to head (e8a2ff7) 92.37%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1023      +/-   ##
============================================
+ Coverage     89.50%   92.37%   +2.87%     
- Complexity     1200     1215      +15     
============================================
  Files           109      110       +1     
  Lines          3086     3331     +245     
============================================
+ Hits           2762     3077     +315     
+ Misses          324      254      -70     
Files Changed Coverage Δ
src/main/php/PHPMD/TextUI/Command.php 100.00% <100.00%> (ø)
src/main/php/PHPMD/TextUI/CommandLineOptions.php 100.00% <100.00%> (+31.22%) ⬆️
src/main/php/PHPMD/Writer/StreamWriter.php 86.36% <100.00%> (+2.15%) ⬆️

... and 96 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

AJenbo
AJenbo previously approved these changes Aug 20, 2023
@kylekatarnls kylekatarnls force-pushed the feature/error-details-output branch 11 times, most recently from 6bf8d5b to e7775e9 Compare August 20, 2023 18:14
@kylekatarnls
Copy link
Member Author

@ravage84 Would you mind to update the required jobs?

Renaming PX.Y => Tests / PHP X.Y for clarity and consistency with PDepend.

And extend range up to PHP version 8.3?

AJenbo
AJenbo previously approved these changes Aug 20, 2023
AJenbo
AJenbo previously approved these changes Aug 20, 2023
Copy link
Member

@AJenbo AJenbo left a comment

Choose a reason for hiding this comment

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

On a side note i think assert regex was removed in recent version, but i might be remembering wrong.

@kylekatarnls
Copy link
Member Author

kylekatarnls commented Aug 20, 2023

On a side note i think assert regex was removed in recent version, but i might be remembering wrong.

Yes, but the new method name is not available in the super-old version we need to use to support PHP 5.3 😢

Even with the "higher" version, it does not show deprecation notice:
https://github.com/phpmd/phpmd/actions/runs/5919541857/job/16049919112?pr=1023#step:7:1

@AJenbo
Copy link
Member

AJenbo commented Aug 20, 2023

Hm the other main project I'm working with builds natively for 1987 Amiga and 2022 Android, I'm starting to question my life decisions.

AJenbo
AJenbo previously approved these changes Aug 21, 2023
src/site/rst/documentation/index.rst Outdated Show resolved Hide resolved
src/test/php/bootstrap.php Show resolved Hide resolved
src/test/php/fix-php-compatibility.php Show resolved Hide resolved
src/test/php/fix-php-compatibility.php Outdated Show resolved Hide resolved
src/test/php/fix-php-compatibility.php Outdated Show resolved Hide resolved
src/test/php/load-coverage-tokens.php Show resolved Hide resolved
@ravage84
Copy link
Member

@ravage84 Would you mind to update the required jobs?

Renaming PX.Y => Tests / PHP X.Y for clarity and consistency with PDepend.

And extend range up to PHP version 8.3?

Done. Should be active with the next builds.

kylekatarnls and others added 4 commits August 21, 2023 15:42
AJenbo
AJenbo previously approved these changes Aug 21, 2023
@ravage84 ravage84 merged commit 63ca48a into phpmd:master Aug 21, 2023
31 checks passed
@kylekatarnls kylekatarnls deleted the feature/error-details-output branch August 21, 2023 16:44
@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants