Modified .yml files are not passed to eslint

Created on 12 January 2023, almost 2 years ago
Updated 8 May 2023, over 1 year ago

Problem/Motivation

In patch and MR tests, the eslint is run by default on the modified files. Currently these are filtered only for .js files. This means that any changed .yml files are not reported, giving a false impression that all is clean. Then on commit the full codebase is tested and you get a surprise that there are eslint coding faults.

Steps to reproduce

Create a patch or MR with a change to a .yml file introducing a coding standard fault. It won't be reported. (make sure you are not changing a file ignored by .eslintignore)

Proposed resolution

Add .yml into the preg_grep in Eslint::getLintableFiles()

Remaining tasks

MR will follow

🐛 Bug report
Status

Needs review

Component

Testrunner Codebase

Created by

🇬🇧United Kingdom jonathan1055

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom jonathan1055

    Just for clarity, the only real code change is the pattern match in the single line

    preg_grep("{.*\.js$}",$this->codebase->getModifiedFiles());
    

    which becomes

    preg_grep("{.*\.(js|yml)$}",$this->codebase->getModifiedFiles());
    

    The other changes are comments and the variable name change.

Production build 0.71.5 2024