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

Support file globbing, and STDIN #1025

Merged
merged 4 commits into from
Aug 21, 2023
Merged

Conversation

kylekatarnls
Copy link
Member

@kylekatarnls kylekatarnls commented Aug 20, 2023

Type: feature
Issue: Fix #185
Breaking change: no

Allow to use the input as the file content with - shortcut:

cat src/MyFile.php | ./src/bin/phpmd - text foo/rules.xml

Allow to scan multiple files selected via glob pattern:

./src/bin/phpmd src/*Suffix.php text rules.xml

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (8c246f3) 89.45% compared to head (59152f4) 89.46%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1025   +/-   ##
=========================================
  Coverage     89.45%   89.46%           
- Complexity     1198     1199    +1     
=========================================
  Files           109      109           
  Lines          3082     3084    +2     
=========================================
+ Hits           2757     2759    +2     
  Misses          325      325           
Files Changed Coverage Δ
src/main/php/PHPMD/TextUI/CommandLineOptions.php 68.77% <100.00%> (+0.23%) ⬆️

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

AJenbo
AJenbo previously approved these changes Aug 20, 2023
@tvbeek tvbeek merged commit 638eb73 into phpmd:master Aug 21, 2023
29 checks passed
@kylekatarnls kylekatarnls deleted the feature/stdin branch August 21, 2023 13:39
@ravage84
Copy link
Member

😎 🎉

Once this is released, I will contact JetBrains about it, so they can integrate PHPMD through stdin.

Since PHPMD has kept backwards compat it shouldn't be a problem for almost 100 % of our user base to upgrade to the newest relase containing this feature.

@kylekatarnls
Copy link
Member Author

Note that it only provide a shortcut from - to php://stdin but older versions already support it via the long form:

cat src/MyFile.php | ./src/bin/phpmd php://stdin text foo/rules.xml

@ravage84
Copy link
Member

@kylekatarnls yeah. i'm aware of that. Thanks.

Having both ways will only make it easier for them to integrate PHPMD through stdin.

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

Successfully merging this pull request may close these issues.

Support POSIX file globbing, and STDIN.
4 participants