Skip to content

Project structure improvement #2

Closed
@GaryJones

Description

@GaryJones

Here's a screenshot of using your project:

screenshot 2017-11-02 10 14 22

I added this standard to my composer, and the DealerDirect plugin you recently added support for seemed to register it. Note, however, that the standard is simply the vendor name, and not the vendor/package name, as per the other standards (which have had support for the DealerDirect plugin for a while now). One obvious issue, is that should you come up with a new repo for a different PHPCS standard, there will be a conflict.

Here's the relevant part of my .phpcs.xml.dist:

<rule ref="ObjectCalisthenics"/>
<rule ref="phpcs-variable-analysis.CodeAnalysis.VariableAnalysis"/>
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="7.1-"/>
<config name="minimum_supported_wp_version" value="4.7"/>
<rule ref="WordPress">
	<exclude name="WordPress.VIP"/>
</rule>

Again, note that I need to add the full path to the sniff for your repo, unlike in other standards. I would expect to just be able to use <rule ref="phpcs-variable-analysis"/>, or <rule ref="VariableAnalysis"/> (as an updated top-level name of the standard), so that any future sniffs you add would be automatically used.

I suspect the issue is the directory layout - see PHPCompatibility/PHPCompatibility#446 for relevant discussion of what PHPCompatibility had to do (they were also trying to maintain BC, but you may feel that your project is young enough to fix the layout, bump the major version number and move on).

If you look at the repos for PHPCompatibility and WPCS they have a structure of:
{repo}->StandardName->Sniffs+ruleset.xml.

ObjectCalisthenics has it as:
{repo}->src->StandardName->Sniffs+ruleset.xml.

However, your repo here doesn't have that StandardName level. It is simply:
{repo}->Sniffs+ruleset.xml.

If you moved your Sniffs/, Tests/ and ruleset.xml all into a new top-level VariableAnalysis/ directory, then I think the issue will just about be solved, and you'll be consistent with the other standards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions