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

Invalid docblock tag "@group". #145

Closed
gjb2048 opened this issue Apr 1, 2024 · 7 comments · Fixed by #146
Closed

Invalid docblock tag "@group". #145

gjb2048 opened this issue Apr 1, 2024 · 7 comments · Fixed by #146

Comments

@gjb2048
Copy link

gjb2048 commented Apr 1, 2024

Using version 3.4.5 - https://github.com/moodlehq/moodle-cs/releases/tag/v3.4.5 - manually downloaded and installed in appropriate vendor folder, I get:

Screenshot 2024-04-01 135230

with the code:

Screenshot 2024-04-01 135308

and yet https://moodledev.io/general/development/tools/phpunit#using-the-group-annotation states that the tag is valid and how it can be used on the test class - not the test method as stated on https://docs.phpunit.de/en/9.6/annotations.html#group (using PHPUnit 9.6.18 in M4.4 dev - 4.4dev+ (Build: 20240326)).

@andrewnicols
Copy link
Contributor

I suspect this is a case of Windows pathnames not being normalised. Our comparisons for valid paths use a regex of '#.*/tests/.*_test.php#'.

Writing a test now to confirm this.

andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 1, 2024
andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 1, 2024
andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 1, 2024
andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 1, 2024
andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 1, 2024
@andrewnicols andrewnicols linked a pull request Apr 1, 2024 that will close this issue
@andrewnicols
Copy link
Contributor

Thanks Gareth,

This appears to be a Windows path normalisation issue. I've:

  • added tests to run on Windows
  • added a specific test for @group
  • added path normalisation which addresses these and other issues

Eloy is on leave for the next few days so I'm afraid it's unlikely that this will get looked at before then. If you're running locally you can clone this repo, merge the branch in #146 locally and run it from there by pointing a repository to it. This is my ~/.composer/composer.json for reference:

{
    "require": {
        "moodlehq/moodle-cs": "dev-main"
    },
    "config": {
        "allow-plugins": {
            "dealerdirect/phpcodesniffer-composer-installer": true
        }
    },
    "repositories": [
      {
        "type": "path",
        "url": "/Users/nicols/git/moodlehq/moodle-cs"
      }
    ],
    "minimum-stability": "dev"
}

@gjb2048
Copy link
Author

gjb2048 commented Apr 1, 2024

@andrewnicols Thank you :), I'll have a go as soon as I can (today I hope) as indeed running locally.

@gjb2048
Copy link
Author

gjb2048 commented Apr 1, 2024

@andrewnicols Working, thank you :). I couldn't work out the composer.json replacement, so instead downloaded the code (zip) from https://github.com/andrewnicols/moodle-cs/tree/phpunitTags and replaced manually.

@andrewnicols
Copy link
Contributor

Good stuff @gjb2048, I'll try and remember to ping you when we release so you an roll that back.

andrewnicols added a commit to andrewnicols/moodle-cs that referenced this issue Apr 3, 2024
sarjona pushed a commit to andrewnicols/moodle-cs that referenced this issue Apr 3, 2024
@andrewnicols
Copy link
Contributor

@gjb2048, you should be able to update from composer to fix this issue.

@gjb2048
Copy link
Author

gjb2048 commented Apr 3, 2024

@andrewnicols Thank you :)

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

Successfully merging a pull request may close this issue.

2 participants