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

Find phpcs.xml config file in parent directories #626

Closed
petersendidit opened this issue Jun 19, 2015 · 2 comments
Closed

Find phpcs.xml config file in parent directories #626

petersendidit opened this issue Jun 19, 2015 · 2 comments

Comments

@petersendidit
Copy link

If you run phpcs from a directory below the level that the phpcs.xml file is phpcs doesn't use that config.

After using eslint for a while I have gotten use to being able to call the eslint command from any directory and it honoring the .eslintrc config. Eslint handles this with a findInDirectoryOrParent method: https://github.com/eslint/eslint/blob/master/lib/file-finder.js#L57

This would help editors also to be able to easily pick up the phpcs.xml config

@gsherwood
Copy link
Member

This is something I want to do, but it's not as simple as just looking up the tree because I want to combine this with the other related feature people ask for, which is to have PHPCS change standards when it finds a phpcs.xml file inside a directory. This allows you to have slightly (or completely) different standards for various parts of the codebase, which is helpful if you are including libraries, or want different standards for integration code or unit tests.

This will probably only get added to the 3.0 version because it would be a lot easier with the refactoring I've done in the 3.0 branch.

gsherwood added a commit that referenced this issue Nov 25, 2015
… and is used even if files are specificed on the CLI
gsherwood added a commit that referenced this issue Nov 25, 2015
… and is used even if files are specificed on the CLI
@gsherwood
Copy link
Member

I decided that it would be better to not do this feature with the one that allows different standards in different parts of the tree. This new feature is now committed.

jrfnl added a commit to jrfnl/PHP_CodeSniffer that referenced this issue Nov 4, 2024
…dstartofstatement-fix-dataproviders

Tests/File::findStartOfStatement(): fix dataproviders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants