Skip to content

RFC: Create new "codefixer" Command #75

Open
@stronk7

Description

@stronk7

Right now we have the codechecker command that reports all the issues found by phpcs. This is useful locally and @ CIs.

Also, there is the codecbf command that also runs phpcs but in fix mode, changing as much as possible. Always exiting without error (exit code = 0). This is useful locally, but not much @ CIs.

So this is a proposal to create a new codefixer command, pretty much like the codecbf one (in fact it could end replacing it, more below) with the following features:

  • Run the phpcs fixer.
  • If there are changes performed exit with error.

So the proposal is as follows:

  1. Create new codefixer command.
  2. Make it exit with error if fixes have been applied.
  3. Allow it to always exit without error (via switch), so we can, one of:
    A) remove current codecbf command completely. Or
    B) keep it, but making it to call to the new command with appropriate switch.

That way, for people wanting to add it, it will ensure that as much as possible of phpcs detected problems have been fixed (interesting for CI) and, still, for people just wanting to run it (as part of local dev process or other automations) ignoring the exit status, there will be a switch available.

Ciao :-)

Edited: Surely will have to be done together with #74

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions