Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Rename phpcs.xml to phpcs.xml.dist #1753

Merged
merged 1 commit into from
Jul 5, 2017
Merged

chore: Rename phpcs.xml to phpcs.xml.dist #1753

merged 1 commit into from
Jul 5, 2017

Conversation

ntwb
Copy link
Member

@ntwb ntwb commented Jul 5, 2017

This change allows users to define a local phpcs.xml configuration for their own use. For example a user may want to use the colors option for CLI output as that was requested in #1685.

See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file

This change allows users to define a local `phpcs.xml` configuration for their own use. For example a user may want to use the `colors` option for CLI output as that was requested in #1685.

See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file
@westonruter westonruter merged commit 3037de6 into WordPress:master Jul 5, 2017
@ntwb ntwb deleted the fix/rename-phpcs-dist branch July 6, 2017 00:02
@youknowriad
Copy link
Contributor

This is confusing to me, why do we want this to be a dist, we want everyone to use the same codestyle don't we?

@westonruter
Copy link
Member

Some may want the code style to be even more restrictive, a superset. Or they may want to specify additional default args. A phpcs.xml ruleset can extend the phpcs.xml.dist ruleset by including:

<rule ref="phpcs.xml.dist"/>

@youknowriad
Copy link
Contributor

yeah I know but do we have this for eslint? I don't think this is valuable, I think we should enforce the same thing without any change for everyone. If we want it to be stricter we should add it for everyone.

@ntwb
Copy link
Member Author

ntwb commented Jul 7, 2017

It doesn't have to be about rules, here's an example phpcs.xml file to make my terminal output a little prettier:

<?xml version="1.0"?>
<ruleset name="@netweb's custom `phpcs.xml` for Gutenberg Plugin">

	<rule ref="phpcs.xml.dist"/>

	<!-- Use colors in output -->
	<arg value="-colors"/>

	<!-- Show Progress -->
	<arg value="p"/>

</ruleset>
<!-- https://gist.github.com/ntwb/2df0042c9a50466a20eb41a8070f5fe5 -->

Another example, with PHPUnit this same approach is possible (even here in Gutenberg), with bbPress I've a custom phpunit.xml file that I use to add a listener for @covers annotations in test files, it adds extra overhead and shouldn't be in the main repo's phpunit.xml.dist file but is a great addition for myself locally for a bbPress side project.

@youknowriad
Copy link
Contributor

here's an example phpcs.xml file to make my terminal output a little prettier:

If it's make it prettier, let's add it for everyone

I use to add a listener for @Covers annotations in test files, it adds extra overhead and shouldn't be in the main repo's phpunit.xml.dist file but is a great addition for myself locally for a bbPress side project.

Shouldn't this be for the bbPress project, why do we need it for gutenberg.

@ntwb
Copy link
Member Author

ntwb commented Jul 7, 2017

If it's make it prettier, let's add it for everyone

It wasn't added because of this #1685 (comment)

Shouldn't this be for the bbPress project, why do we need it for gutenberg.

It was just an example use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants