Skip to content

[Dev][Coding Standard] Hundreds of PHPCS-based static tests violations in mainline #8612

Closed
@orlangur

Description

@orlangur

This issue is NOT about @codingStandardsIgnoreFile evil annotation appearing quite often: http://prnt.sc/eawtih
The problem is that even except those 666 ignored files there are a lot of not coding standard compliant files due to holes in CI processes and/or bugs in get_changed_files mechanism. This is even more strange as "bump copyright year" commit changed all the files and still didn't reveal these violations.

Preconditions

Use develop branch

Steps to reproduce

Run PHPCS-based tests against full codebase

Expected result

PHPCS-based tests are green

Actual result

https://travis-ci.org/orlangur/magento2/jobs/203250472

1) Magento\Test\Php\LiveCodeTest::testCodeStylePsr2
PHP Code Sniffer has found 16 error(s):
2) Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer has found 176 error(s): 
3) Magento\Test\Php\LiveCodeTest::testAnnotationStandard
PHP Code Sniffer has found 168 error(s): 

Solution

As it turned out, running PHPCS against full codebase takes less than 5 minutes: https://travis-ci.org/orlangur/magento2/jobs/203222909#L554

I propose to remove buggy get_changed_files mechanism for PHPCS-based tests as it does not bring any notable value currently but causes troubles.

I would like to prepare a pull request implementing this approach and eliminating all existing violations if you don't mind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: multipleIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P4No current plan to fix. Fixing can be deferred as a logical part of more important work.Progress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseSeverity: S4Affects aesthetics, professional look and feel, “quality” or “usability”.stale issue

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions