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

Check EOF for all file types #269

Open
sarjona opened this issue Jun 27, 2023 · 2 comments
Open

Check EOF for all file types #269

sarjona opened this issue Jun 27, 2023 · 2 comments

Comments

@sarjona
Copy link
Member

sarjona commented Jun 27, 2023

Currently, we are only checking EOF for PHP files (as described in MDLSITE-6397). However, as @scara raised in MDL-77396, it would be great to also add it to CiBoT for other file types (like CSS).
@stronk7 mentioned (in case it helps to implement it): "We don't look for other files within moodle-cs. Surely we need to add a global whitespace checker to CiBoT (pretty much like the post-checks do, but in CiBoT, allowing zero cases).". 

@stronk7
Copy link
Member

stronk7 commented Jun 27, 2023

For the records, I've been looking to the current Illegal whitespace script that we already have (and use in the post-commit checks), but I'm not sure if it's going to be suitable to be used by CiBoT (pre-commit checks), because it's missing support for some utilities like knowing about the affected files in the patch to examine and other details.

In any case... I'll give to that a try... maybe we can reuse it with some hackery... let's see.

Ciao :-)

@stronk7
Copy link
Member

stronk7 commented May 20, 2024

Today, when looking to other stuff (some tests in local_ci), I've seen that, with this simple test, we can know when any file has an EOL @ EOF:

[[ $(tail -c1 path/to/file) && -f path/to/file ]]

And it shouldn't be very hard to add it as a main check to be reported in the new "overview" section of CiBoT (see #297). Maybe the only problematic point is to be able to exclude any binary files (images, mainly, ...) that are not subject to the rule.

I'll try to give to this a try...

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