diff --git a/CodeSniffer.php b/CodeSniffer.php index 2aa14f5c3f..64ae6185f5 100644 --- a/CodeSniffer.php +++ b/CodeSniffer.php @@ -2169,6 +2169,12 @@ public static function isInstalledStandard($standard) */ public static function getInstalledStandardPath($standard) { + if (substr($standard, 0, 2) == '~/' && is_dir($fromHome = getenv('HOME') . substr($standard, 1))) { + if (is_file($path = self::realpath($fromHome.DIRECTORY_SEPARATOR.'ruleset.xml'))) { + return $path; + } + $standard = $fromHome; + } $installedPaths = self::getInstalledStandardPaths(); foreach ($installedPaths as $installedPath) { $standardPath = $installedPath.DIRECTORY_SEPARATOR.$standard;