-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cannot use tilde (~) to refer to user home #353
Comments
Yes, using This post explains in detail: http://stackoverflow.com/questions/3963716/how-to-manually-expand-a-special-variable-ex-tilde-in-bash |
I don't think home directory expansion is something PHP_CodeSniffer should be doing. It's something the shell should be doing, which actually works fine in my shell already. |
PHP_CodeSniffer is making use of realpath(), so it's already doing directory expansion, sir. And you might not be using the most used unix shell in the world: bash. But, of course, I respect your decision. Thank you. |
Comparing the use of realpath() and a custom tilde expansion isn't at all fair. If PHP had built-in cross-platform support for expanding The thing I don't want to do is support custom expansions. |
I changed my mind after thinking about this a bit more. I think I was confusing the use of the '~' in the file path and the I've committed a change for this now and would love to know if it works for you. I've tested it both with standard paths passed on the command line and also in standards referenced from other rulesets. Any standard path in there that start with |
Unfortunately on Windows the home folder detection is different. This method in Gush deals with OS inconsistencies: https://github.com/gushphp/gush/blob/59c0c913ab634b39f51438a9b850ec51605131d5/src/Factory.php#L25-L50 |
@gsherwood master branch is working fine for me in an Ubuntu 14.04 using bash & zsh. In my opinion, Windows should not be a concern in the tilde case, because that particular character means nothing on it. Those are tests using MSDOS and 4NT done here:
|
Yeah, I didn't expect the home dir expansion to mean anything in Windows and wasn't adding that feature for Windows users. Of course, Windows users could set a HOME env var if they wanted to. Thanks for testing it @antonioribeiro |
* Docs: add documentation for Squiz.WhiteSpace.ScopeClosingBrace * Docs: improve documentation for Squiz.WhiteSpace.ScopeClosingBrace - Fixup CDATA indentation - Improve wording in code examples - Add more varied code examples * Docs: clarify wording and code samples for Squiz.WhiteSpace.ScopeClosingBrace * Docs: combine code examples in Squiz.WhiteSpace.ScopeClosingBrace Better illustrates that statements can be indented, and that their closing braces still should align with the start of the statement. * Docs: improve examples for Squiz.WhiteSpace.ScopeClosingBrace - Reduces wordiness - Adds an example of too little whitespace * Docs: add missing emphasis in Squiz.WhiteSpace.ScopeClosingBrace * Docs: improve code examples for Squiz.WhiteSpace.ScopeClosingBrace - Combine too little with too much whitespace - Adjust emphasis on example containing PHP tags - Change example paragraph to span for better HTML formatting
You cannot run it this way:
You have to do
Or
The text was updated successfully, but these errors were encountered: