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

Feature/checkstyle renderer #1

Open
wants to merge 145 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
d383bd3
Rename setIgnorePattern to addIgnorePatterns and getIgnorePattern to …
tvbeek May 7, 2020
4f1586c
Update the use of the deprecated functions from PHPMD in the ParserFa…
tvbeek May 7, 2020
d801efd
Update docblocks with feedback from @ravage84
tvbeek May 13, 2020
7ec1d8d
Fix the mocking in the ParserFactoryTest after using the new functions
tvbeek May 13, 2020
754b06b
Remove unwanted empty lines
tvbeek May 13, 2020
0bed148
Update the docblock with @this and add an empty line. Feedback from @…
tvbeek May 13, 2020
554a474
Fix #673 Ignore dynamic class name from missing imports
kylekatarnls May 16, 2020
f6b6f1b
Migrate MissingImport to the new testing system
kylekatarnls May 16, 2020
aa55524
#739 Add unit test to demonstrate the class begin line issue
kylekatarnls May 19, 2020
3ba954e
Merge branch 'master' into feature/issue-673-ignore-dynamic-class-names
kylekatarnls May 20, 2020
b125659
Cleanup merge changes
kylekatarnls May 20, 2020
fc816ad
#739 Upgrade minimum version of PDepend
kylekatarnls Jun 20, 2020
0b1d9b6
#739 Shorten variable name numberOfPublicMethods > publicMethodsCount
kylekatarnls Jun 20, 2020
2e0b64e
#818 Don't check function arguments if the callee is a method
kylekatarnls Sep 4, 2020
0f224c4
Fix #826 consider foreach exception only for direct children
kylekatarnls Sep 24, 2020
3429c96
Change the naming error where possible
tvbeek Oct 29, 2020
f63cbdc
recognize compact variables with double quotes
babanesma Nov 9, 2020
5f25f6c
Merge branch 'master' of https://github.com/phpmd/phpmd into feature/…
kylekatarnls Nov 17, 2020
0d1d21d
Remove the incorrect robots.txt and the reference in the site.ini
tvbeek Dec 1, 2020
429dd39
Fix multiple underscores in method name when allow-underscore-test is…
SanderSander Dec 3, 2020
3fdd5b2
Simplify RegExp
kylekatarnls Dec 3, 2020
953417c
Improve test documentation
SanderSander Dec 3, 2020
e0ff386
adds checkstyle compatible renderer, suitable for cs2pr or reviewdog
ffflabs Dec 31, 2020
4644053
repairs PSR2 code style faults, adds description to README
ffflabs Dec 31, 2020
17558c7
Add GitHub renderer for GitHub Actions
lukasbestle Jan 2, 2021
ce97f2d
Cleanup
kylekatarnls Jan 4, 2021
ae0fbb4
Update src/main/php/PHPMD/TextUI/CommandLineOptions.php
ffflabs Jan 4, 2021
5e8d195
Inherit from XMLRenderer where it's due
ffflabs Jan 4, 2021
7027f9f
Use method 'maybeAdd' from parent renderer
ffflabs Jan 4, 2021
9e4ab02
Remove scalar type declarations and keep file path
ffflabs Jan 5, 2021
c7911cb
Update src/main/php/PHPMD/Renderer/CheckStyleRenderer.php
ffflabs Jan 5, 2021
fe3a473
Merge pull request #857 from lukasbestle/feature/github-renderer
kylekatarnls Jan 7, 2021
97e60fb
Merge branch 'master' into feature/checkstyle_renderer
kylekatarnls Jan 7, 2021
4d81d7c
Unify both allow-underscore RegExps
kylekatarnls Jan 7, 2021
a76d395
Docs for the GitHub renderer
lukasbestle Jan 7, 2021
5eb6c9e
GitHub actions (#848)
tvbeek Jan 7, 2021
1850d20
Cleanup generate_phar.yml
kylekatarnls Jan 7, 2021
10dbc19
Add missing environment variables
kylekatarnls Jan 8, 2021
0cc3270
Merge pull request #864 from kylekatarnls/fix/github-pages
kylekatarnls Jan 8, 2021
5cc2d16
Merge pull request #852 from SanderSander/fix-test-underscore
tvbeek Jan 11, 2021
6140e86
Pass message arguments to RuleViolation
lukasbestle Jan 12, 2021
24b7e9b
AbstractStaticTest: Support custom JSON comparison
lukasbestle Jan 12, 2021
473cc35
AbstractStaticTest: Add placeholder for work dir
lukasbestle Jan 12, 2021
eed53d2
Add SARIF renderer
lukasbestle Jan 12, 2021
41cc1be
Merge pull request #788 from phpmd/feature/issue-739-class-begin-line
kylekatarnls Feb 1, 2021
fe0b08d
Merge branch 'master' of https://github.com/phpmd/phpmd into kylekata…
kylekatarnls Feb 1, 2021
a14fe99
Merge pull request #862 from phpmd/kylekatarnls-cleanup-generate-phar…
kylekatarnls Feb 1, 2021
9373574
Merge pull request #849 from TJVB/remove_robots
kylekatarnls Feb 1, 2021
2d43ca1
Merge pull request #827 from phpmd/feature/issue-826-foreach-catch
kylekatarnls Feb 1, 2021
53eb6f7
Merge pull request #822 from phpmd/feature/issue-818-unit-tests
kylekatarnls Feb 1, 2021
1f8a96d
Merge pull request #772 from TJVB/rename_confusion_functions_in_PHPMD…
kylekatarnls Feb 1, 2021
830897a
Merge pull request #838 from TJVB/naming_rules
kylekatarnls Feb 1, 2021
ee0af7c
Fix #868: Option to ignore globally-namespaced classes from MissingIm…
danepowell Feb 10, 2021
4419c1f
added docs
danepowell Feb 10, 2021
d00dcb1
fix tests
danepowell Feb 11, 2021
43678bd
code style fix
danepowell Feb 11, 2021
515421c
add test case
danepowell Feb 11, 2021
da71279
Update src/site/rst/rules/cleancode.rst
danepowell Feb 12, 2021
b3bdab8
Change exit code on processing errors
lukasbestle Feb 24, 2021
939e6f8
Merge pull request #872 from lukasbestle/feature/514-error-exit-code
kylekatarnls Feb 26, 2021
c3b5bc7
Merge pull request #844 from babanesma/compact_double_quotes
tvbeek Feb 28, 2021
632dcfa
Update src/site/rst/rules/cleancode.rst
danepowell Mar 1, 2021
853f240
Merge pull request #782 from phpmd/feature/issue-673-ignore-dynamic-c…
tvbeek Mar 2, 2021
484d625
Merge pull request #869 from danepowell/issue-868
tvbeek Mar 10, 2021
7ed4ac3
Merge pull request #861 from lukasbestle/feature/docs-github-renderer
tvbeek Mar 10, 2021
543deb7
Added generate-baseline and baseline-basedir to the cli params
frankdekker Mar 28, 2021
cba2ab5
Added BaselineSet
frankdekker Mar 29, 2021
0dafc71
Added coverage BaselineSet + ViolationBaseline
frankdekker Mar 29, 2021
1692338
Added coverage BaselineSetFactory.php
frankdekker Mar 29, 2021
c791a25
Added BaselineSet to Report
frankdekker Mar 29, 2021
512df65
Added BaselineSet to Report
frankdekker Mar 29, 2021
1fe6bc9
Added BaselineSet to Report
frankdekker Mar 29, 2021
48e15c2
Added Baseline to PHPMD.php
frankdekker Mar 29, 2021
4c6cb09
Added BaselineFileFinder to find the baseline file.
frankdekker Mar 29, 2021
5753616
Added BaselineFileFinder to find the baseline file.
frankdekker Mar 29, 2021
312f47b
Added BaselineFileFinder to find the baseline file.
frankdekker Mar 29, 2021
c4d0ee4
Leave basedir argument out-of-scope
frankdekker Mar 30, 2021
f1aeddb
Reduce lines of code in Command
frankdekker Mar 30, 2021
514e30b
Updated documentation
frankdekker Mar 30, 2021
d780225
Updated documentation
frankdekker Mar 30, 2021
d4fbc1c
Remove unnecessary arguments
frankdekker Mar 30, 2021
51c7b31
Complete coverage BaselineSetFactoryTest
frankdekker Mar 30, 2021
0cadaf8
Complete coverage on BaselineFileFinder
frankdekker Mar 30, 2021
03231e6
Complete coverage on Paths concat + getRelativePath
frankdekker Mar 30, 2021
a2913b1
Complete coverage on Paths getAbsolutePath
frankdekker Mar 30, 2021
36259bb
Add coverage for StreamWriter getStream
frankdekker Mar 30, 2021
e77662a
Add coverage for baseline report
frankdekker Mar 30, 2021
0725b63
Add coverage for baseline report
frankdekker Mar 30, 2021
48bad0e
Add coverage for BaselineRenderer
frankdekker Apr 1, 2021
9685b14
Add coverage for RendererFactory
frankdekker Apr 1, 2021
4106f8f
Add coverage for RendererFactory
frankdekker Apr 1, 2021
3084cb1
Add coverage for RendererFactory
frankdekker Apr 1, 2021
969deae
Add coverage for CommandLineOptions
frankdekker Apr 1, 2021
53cb91f
Adjust baseline renderer to include method name
frankdekker Apr 1, 2021
990ce56
Adjust baseline renderer to include method name
frankdekker Apr 1, 2021
0fd3321
Add coverage for method type
frankdekker Apr 1, 2021
d68db93
Add coverage for method type
frankdekker Apr 1, 2021
a09a15e
Update documentation
frankdekker Apr 1, 2021
46f2aeb
Added realpath + coverage
frankdekker Apr 1, 2021
4ef9bc1
Added realpath + coverage
frankdekker Apr 1, 2021
31c93de
Removed basedir from BaselineFactory
frankdekker Apr 1, 2021
c8ef297
Add coverage Command generateBaseline
frankdekker Apr 1, 2021
8d0096b
Add coverage Command generateBaseline
frankdekker Apr 1, 2021
b19b3bf
Add coverage Command::main
frankdekker Apr 2, 2021
702ae3b
Add coverage PHPMD::processFiles
frankdekker Apr 2, 2021
202bd76
Final adjustments
frankdekker Apr 2, 2021
b778c50
replace createMock with getMockBuilder
frankdekker Apr 2, 2021
09268ba
Remove expects
frankdekker Apr 2, 2021
e910232
Replace STDOUT with older php notation
frankdekker Apr 2, 2021
aa6de32
Fix scrutinizer violations
frankdekker Apr 2, 2021
c612432
Revert scrutinizer violations
frankdekker Apr 2, 2021
31746b3
Revert scrutinizer violations
frankdekker Apr 2, 2021
b36f8a7
Fix scrutinizer warnings
frankdekker Apr 2, 2021
a7464a5
Fix scrutinizer warnings
frankdekker Apr 2, 2021
edad487
Update CONTRIBUTING.md
tvbeek Apr 6, 2021
281a8da
Merge pull request #873 from frankdekker/violation-baseline
kylekatarnls Apr 11, 2021
1027dee
Merge pull request #1 from phpmd/master
frankdekker Apr 11, 2021
42a2686
Fix slashes when running tests on windows environment
frankdekker Apr 11, 2021
23f62fa
Merge pull request #874 from TJVB/update_contributing
kylekatarnls Apr 11, 2021
95efe0b
Merge pull request #875 from frankdekker/violation-baseline-appveyor-…
kylekatarnls Apr 12, 2021
e2241d9
Add BaselineMode + Update CommandLineOptions to support --update-base…
frankdekker Apr 12, 2021
16dcb73
Replace BaselineSet with Report in PHPMD::processFiles method
frankdekker Apr 12, 2021
c14a9fe
Added BaselineValidator
frankdekker Apr 12, 2021
9056d48
Add tests for BaselineValidator
frankdekker Apr 12, 2021
6fa9c52
Add tests for BaselineValidator
frankdekker Apr 12, 2021
09b1610
Add tests for BaselineValidator
frankdekker Apr 12, 2021
f1eaecf
Fixes: unlink($tempFile): Resource temporarily unavailable
frankdekker Apr 12, 2021
0987138
Merge pull request #2 from phpmd/master
frankdekker Apr 12, 2021
cf1be81
Add tests for BaselineValidator
frankdekker Apr 12, 2021
1aba7ac
Remove unused imports
frankdekker Apr 12, 2021
060e648
Add coverage Command
frankdekker Apr 12, 2021
7b9cc40
Add coverage CommandTest for update baseline
frankdekker Apr 12, 2021
7677002
Update documentation
frankdekker Apr 12, 2021
4363588
Update documentation
frankdekker Apr 12, 2021
3861911
Update documentation
frankdekker Apr 12, 2021
5ee4218
Update documentation
frankdekker Apr 12, 2021
dacb391
Update documentation
frankdekker Apr 12, 2021
07dd69d
Appease scrutinizer: suppress PHP7.4 getMock error
frankdekker Apr 12, 2021
902a340
Merge pull request #876 from frankdekker/update-violation-baseline
tvbeek Apr 13, 2021
064810c
Merge branch 'master' into feature/sarif-renderer
kylekatarnls Apr 16, 2021
7ffb7b7
Indent long line
kylekatarnls Apr 16, 2021
c826a7c
Merge pull request #865 from lukasbestle/feature/sarif-renderer
kylekatarnls Apr 16, 2021
b5421a0
Merge branch 'master' into feature/checkstyle_renderer
kylekatarnls Apr 16, 2021
fdd2e37
Stick cast to variable (PHPCS compliance)
kylekatarnls Apr 17, 2021
0101e01
Align PHPDoc asterix
kylekatarnls Apr 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove scalar type declarations and keep file path
  - As phpmd is meant to run in a broad range of php versions,
    we cannot rely on features that wouldn't run in PHP 5.4.x
  - Violation fileName shoulnd't be modified. Any path canonicalization
    needed by an external tool should be applied afterwards
  • Loading branch information
ffflabs committed Jan 5, 2021
commit 9e4ab0223fd8d2ef6b62880bde6c16802e2bc653
5 changes: 3 additions & 2 deletions src/main/php/PHPMD/Renderer/CheckStyleRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPMD\PHPMD;
use PHPMD\Report;
use PHPMD\Renderer\XMLRenderer;

/**
* This class will render a Java-checkstyle compatible xml-report.
* for use with cs2pr and others
Expand All @@ -30,7 +31,7 @@ class CheckStyleRenderer extends XMLRenderer
* @param integer $priority priority of the broken rule
* @return string either error, warning or info
*/
protected function mapPriorityToSeverity(int $priority):string
protected function mapPriorityToSeverity($priority)
{
if ($priority>2) {
return 'info';
Expand All @@ -50,7 +51,7 @@ public function renderReport(Report $report)
$writer->write(\PHP_EOL);

foreach ($report->getRuleViolations() as $violation) {
$fileName = \str_replace(__DIR__ . \DIRECTORY_SEPARATOR, '', $violation->getFileName());
$fileName = $violation->getFileName();

if ($this->fileName !== $fileName) {
// Not first file
Expand Down