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

Expected empty line after the boilerplate check breaks all workplace code #168

Closed
marinaglancy opened this issue Jun 17, 2024 · 2 comments · Fixed by #169
Closed

Expected empty line after the boilerplate check breaks all workplace code #168

marinaglancy opened this issue Jun 17, 2024 · 2 comments · Fixed by #169

Comments

@marinaglancy
Copy link
Member

Hello! We have a problem with the new moodle-cs

FILE: /home/marina/repositories/workplace/wp404-first/moodle/admin/tool/catalogue/lib.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 16 | ERROR | [x] Boilerplate comment must be followed by a single blank line or end of file
    |       |     (moodle.Files.BoilerplateComment.SingleTrailingNewLine)
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

this fails on every single file in workplace because we have a boilerplate that includes workplace clause

Screenshot from 2024-06-17 09-26-00

our boilerplates look like this and it was perfectly fine before, passed all cs checks. We modified the first line - that this is part of Moodle Workplace and not Moodle and also added our own text in the bottom

@stronk7
Copy link
Member

stronk7 commented Jun 17, 2024

Just noting that the problem is not the "customisation" in the first line, that continues being allowed as it was, so far.

Instead, the problem is the "extra" boilerplate text after the official one. And the lack of one blank like after the official part (line 16).

I think that what we should do is to:

  1. Allow the "extra" (consecutive) boilerplate to exist, with any contents.
  2. Apply the SingleTrailingNewLine after the extra boilerplate (instead of current "in the middle" behaviour).

Ciao :-)

@stronk7
Copy link
Member

stronk7 commented Jun 17, 2024

Note that #169 has been created and, hopefully, fixes this.

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