{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330","labels_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330/labels{/name}","comments_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330/comments","events_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330/events","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330","id":60894203,"number":330,"title":"Spaces in JS block incorrectly flagged as indentation error","user":{"login":"paulschreiber","id":86784,"avatar_url":"https://avatars.githubusercontent.com/u/86784?v=3","gravatar_id":"","url":"https://api.github.com/users/paulschreiber","html_url":"https://github.com/paulschreiber","followers_url":"https://api.github.com/users/paulschreiber/followers","following_url":"https://api.github.com/users/paulschreiber/following{/other_user}","gists_url":"https://api.github.com/users/paulschreiber/gists{/gist_id}","starred_url":"https://api.github.com/users/paulschreiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulschreiber/subscriptions","organizations_url":"https://api.github.com/users/paulschreiber/orgs","repos_url":"https://api.github.com/users/paulschreiber/repos","events_url":"https://api.github.com/users/paulschreiber/events{/privacy}","received_events_url":"https://api.github.com/users/paulschreiber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-12T20:26:21Z","updated_at":"2015-03-14T14:00:43Z","closed_at":null,"body":"Sample code:\r\n```php\r\n<?php\r\nclass Foo {\r\n\tpublic static function bar( $atts ) {\r\n\t\t$script = \"\r\n      <script>\r\n        DV.load('https://www.documentcloud.org/documents/$id.js', {\r\n          width: '\" . esc_js( $width ) . \"',\r\n          height: '\" . esc_js( $height ) . \"',\r\n          foo: 'bar'\r\n        });\r\n      </script>\r\n      <style>#DV-viewer-{$id}</style>\";\r\n\r\n\t\treturn $script;\r\n\t}\r\n}\r\n```\r\n\r\nWhen I run PHPCS:\r\n```\r\n$ phpcs -p -s -v --standard=WordPress-VIP sample.php\r\n```\r\n\r\nI get this output:\r\n```\r\n----------------------------------------------------------------------\r\nFOUND 1 ERROR AFFECTING 1 LINE\r\n----------------------------------------------------------------------\r\n 8 | ERROR | [x] Tabs must be used to indent lines; spaces are not\r\n   |       |     allowed\r\n   |       |     (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed)\r\n----------------------------------------------------------------------\r\nPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY\r\n----------------------------------------------------------------------\r\n```\r\n\r\nIf you delete either the width or the height line, the error goes away."},"comment":{"url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/comments/80499464","html_url":"https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330#issuecomment-80499464","issue_url":"https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/330","id":80499464,"user":{"login":"paulschreiber","id":86784,"avatar_url":"https://avatars.githubusercontent.com/u/86784?v=3","gravatar_id":"","url":"https://api.github.com/users/paulschreiber","html_url":"https://github.com/paulschreiber","followers_url":"https://api.github.com/users/paulschreiber/followers","following_url":"https://api.github.com/users/paulschreiber/following{/other_user}","gists_url":"https://api.github.com/users/paulschreiber/gists{/gist_id}","starred_url":"https://api.github.com/users/paulschreiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulschreiber/subscriptions","organizations_url":"https://api.github.com/users/paulschreiber/orgs","repos_url":"https://api.github.com/users/paulschreiber/repos","events_url":"https://api.github.com/users/paulschreiber/events{/privacy}","received_events_url":"https://api.github.com/users/paulschreiber/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T14:00:43Z","updated_at":"2015-03-14T14:00:43Z","body":"What @GaryJones and @westonruter said is true. Regardless, there's something odd with the parser if it flags the indentation like it does — I would expect it to flag all of the lines as needing tabs (or none of them), not just one.\r\n\r\nShould I report this to PHPCS/squiz labs?"}}