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

Removing a phpdoc will not checked by the diffFilter #69

Open
cydrickn opened this issue Dec 17, 2021 · 2 comments
Open

Removing a phpdoc will not checked by the diffFilter #69

cydrickn opened this issue Dec 17, 2021 · 2 comments

Comments

@cydrickn
Copy link

I have an issue, I tested this scenario where we remove a php comment docs. But that doc is needed for phpcs to check.
But what happen it went out it passed the checker.

diff.text

diff --git a/<path>/country_controller.php b/<path>/country_controller.php
index 0965de3e93..73afffd042 100644
--- a/<path>/country_controller.php
+++ b/<path>/country_controller.php
@@ -1,13 +1,4 @@
 <?php
-/**
- * Controller to retrieve information about a country
- *
- * PHP version 5
- *
- * @author    Sample Author <sampleauthor@sample.com>
- * @copyright Sample Copyright
- */
 namespace <namespace>;
 
 class Country_Controller extends Base_Controller {

phpcs.json

{
  "totals": {
    "errors": 3,
    "warnings": 0
  },
  "files": {
     "<path>\/country_controller.php": {
      "errors": 1,
      "warnings": 0,
      "messages": [
        {
          "message": "Missing file doc comment",
          "source": "CSNStores.Commenting.FileComment.Missing",
          "severity": 5,
          "type": "ERROR",
          "line": 2,
          "column": 1
        }
      ]
    }
  }
}

the output of the difffilter will be

php ./.ci/diffFilter.phar --phpcsStrict diff.txt phpcs.json
    100.00% Covered

The expected for this, it should have an error.

@exussum12
Copy link
Owner

Hi!

Thanks for reporting this, is your company CSNStores?

There are over rides for this https://github.com/exussum12/coverageChecker/blob/master/src/Loaders/PhpCs.php#L35

I have added the squiz sniffs, I could make that user configurable too, If that is a public sniff (I can't see it from a quick google) I will add to the base config, if not I can make that array be adjusted by a users config.

I raised an issue a while back on phpcs as that error is not really on line 2, its the whole file in that case. It was discussed a while back
squizlabs/PHP_CodeSniffer#1680 (comment)

@cydrickn
Copy link
Author

cydrickn commented Jan 4, 2022

CSNStores.Commenting.FileComment.Missing is our own rule

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

No branches or pull requests

2 participants