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

Handle filename in PHPCS output without leading '/' #148

Merged
merged 10 commits into from
Mar 1, 2021

Conversation

gudmdharalds
Copy link
Contributor

@gudmdharalds gudmdharalds commented Feb 25, 2021

With some PHPCS rulesets, the following notice might be printed:

Notice: Undefined index: /tmp/vipgoci-phpcs-scan-WEevWG.php in /home/circleci/project/vip-go-ci/phpcs-scan.php on line 566

This is because vip-go-ci will look for results returned by PHPCS by using the full file-path to the file, but in some cases the leading / is skipped in the file-path. This patch will cover both cases.

Note that with PHPCS, the leading / can be skipped by using this configuration in the ruleset:

<arg name="basepath" value="."/>

TODO:

  • [N/A] Specify a parameter to make [feature] configurable
  • Fix problem with file-path while processing results from PHPCS
  • Add unit-test to cover both with and without / in file-path
  • [N/A] Update README
  • Run full-unit tests
  • Check automated unit-tests

@gudmdharalds gudmdharalds self-assigned this Feb 25, 2021
@gudmdharalds gudmdharalds changed the title Filename in PHPCS output is sometimes without leading "/", cover this. Handle filename in PHPCS output without leading '/' Feb 25, 2021
@gudmdharalds gudmdharalds merged commit 44521f7 into master Mar 1, 2021
@gudmdharalds gudmdharalds deleted the fix-phpcs-basepath branch March 3, 2021 13:23
@gudmdharalds gudmdharalds added this to the 1.0.0 milestone May 11, 2021
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.

1 participant