Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Standards should be referenced by name #79

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

Open
szepeviktor wants to merge 2 commits into webimpress:master
base: master
Choose a base branch
Loading
from szepeviktor:patch-1

Conversation

@szepeviktor
Copy link
Contributor

@szepeviktor szepeviktor commented Jan 25, 2020
edited
Loading

Should I move args to the example in README?

Copy link
Contributor Author

szepeviktor commented Jan 25, 2020
edited
Loading

WebimpressCodingStandard could be called Webimpress as it is already known to be a phpcs coding standard.

See

$ vendor/bin/phpcs -i
The installed coding standards are PEAR, Squiz, MySource, PSR1, Zend, PSR12 and PSR2

<ruleset name="MyCodingStandard"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/webimpress/coding-standard/ruleset.xml"/>
Copy link
Member

@michalbundyra michalbundyra Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what's wrong with that method?

Copy link
Contributor Author

@szepeviktor szepeviktor Jan 25, 2020
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All phpcs ruleset I've seen/made have a name and can be used by its name.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is still relevant, but I came across this PR when looking for something else.

@michalbundyra I've previously seen issues with sniff name based configuration not always working 100% correctly when a ruleset is imported via a file ref vs by name.

I suppose I should do a deep-dive into this at some point, but I agree with the recommendation that standards containing sniffs should be reference-able by name and that the recommendation should be to register them in installed_paths and include them by name.

Also see my comments here:

Copy link
Member

@michalbundyra michalbundyra Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jrfnl ! I'll have a look and try to sort it out.

jrfnl reacted with thumbs up emoji
<file>test</file>
<file>config/</file>
<file>src/</file>
<file>test/</file>
Copy link
Member

@michalbundyra michalbundyra Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess these are not really needed?

Copy link
Contributor Author

@szepeviktor szepeviktor Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. They show that for example src is a directory, not a file.


<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
Copy link
Member

@michalbundyra michalbundyra Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these are removed?
I wanted to have enabled progress and colours by default.

Copy link
Contributor Author

@szepeviktor szepeviktor Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because command line options should be in the user's phpcs.xml, not in the coding standard.

jrfnl reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@michalbundyra michalbundyra michalbundyra left review comments

+1 more reviewer

@jrfnl jrfnl jrfnl left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /