•  
      request #13068 Start enforcing Tuleap PHP coding standard in CI pipelines
    Infos
    #13068
    Thomas Gerbet (tgerbet)
    2019-04-29 09:11
    2019-03-01 17:13
    13933
    Details
    Start enforcing Tuleap PHP coding standard in CI pipelines
    Currently the PHP coding standard is only enforced through a pre-commit hook and things might be missed.

    This step should be enforced by the CI.


    PHPCS [0] is not able to silence an existing set of issue in the codebase. As such, and to avoid too much false-positive, the sane approach [1] seems to progressively add rule to enforce to fix the corresponding issues all over the codebase.

    The existing pre-commit hook will be kept as is to try to do the best it can to detect issues and the CI will enforce a subset of the ruleset.


    To test the approach, a new coding standard rule is going to be added: the unused use in the PHP files will now be rejected.


    [0] https://github.com/squizlabs/PHP_CodeSniffer/
    [1] https://github.com/squizlabs/PHP_CodeSniffer/issues/2094#issuecomment-409688782
    Dev tools
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2019-03-18
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2019-03-18 15:13
    Initial integration seems to work as expected let's close.

    • Status changed from Under review to Closed
    • Close date set to 2019-03-18
    User avatar
    Thomas Gerbet (tgerbet)2019-03-06 18:18
    Let's try again with something less aggressive than the removal of unused use statements. Let's try to forbid the usage of the PHP short open tag, see gerrit #14316.

    • Status changed from Reopen to Under review