moodlehq / moodle-cs

Moodle Coding Style
https://github.com/moodlehq/moodle-cs
GNU General Public License v3.0
18 stars 15 forks source link

Fixes #174. Insert boilerplate correctly where comment on first line. #175

Closed micaherne closed 2 months ago

micaherne commented 2 months ago

This fixes #174

I've added a test fixture to make sure it works as expected. I'd rather there was a blank line between the boilerplate and the original comment but I can't find a way to do this that doesn't either break other tests, or require a lot of complicated code, so hopefully what it's doing is acceptable.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.11%. Comparing base (a0bfb12) to head (8965b35).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #175 +/- ## ========================================= Coverage 98.11% 98.11% - Complexity 950 951 +1 ========================================= Files 40 40 Lines 2811 2816 +5 ========================================= + Hits 2758 2763 +5 Misses 53 53 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

micaherne commented 2 months ago

I'm not sure what to do about the code coverage failure here. I haven't really changed the lines it's complaining about, just moved them. They'll presumably only be called now if there is a PHPCS tag on the first line but I'm not sure I quite understand how that is supposed to work so I don't think I can provide a test file.

micaherne commented 2 months ago

Oops I don't know how I managed that! That's it fixed now :)