Skip to content

Consider php lint for Github Actions #5296

@indigoxela

Description

@indigoxela

Description of the need

It doesn't happen often, but sometimes a syntax error sneaks in.
It can be a more obvious one that only got overlooked in a very big PR, for instance in an automated test. It can be a more subtle one, that only strikes on older PHP versions (short array syntax, using empty() with non-variables...) (the oldest officially supported PHP version is now 5.6.)

Anyway, it would be so easy to prevent that by simply running php -l on all changed files, for the oldest and newest PHP Backdrop supports.

Additional information

Not sure if this works as-is in the runners, but here's a simple bash one-liner that works for me locally:

git diff --name-only 1.x... | while read LINE; do php -l $LINE; done;

Feedback is welcome. 😃

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Proposed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions