Closed annalinneajohansson closed 7 years ago
I think this is a problem with this package, I think its a problem with phpcs itself. At a guess you are producing an error which is breaking the JSON output of phpcs. Do you have a sample of the file? Have you tried running phpcs manually over the file?
It's happening on save, on any php file. The one in question only contains:
add_action( 'wp_enqueue_scripts', 'storefront_parent_theme_enqueue_styles' );
function storefront_parent_theme_enqueue_styles() { wp_enqueue_style( 'storefront-style', get_template_directory_uri() . '/style.css' ); /**
- @todo Add Google Fonts section to the customizer */ wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Playfair+Display|Varela', array(), 1 ); wp_enqueue_style( 'hoxton-storefront-style', get_stylesheet_directory_uri() . '/style.css', array( 'storefront-style', 'google-fonts' ) );
}
Running phpcs on the file looks like this (not sure what it should look like, don't normally use it on the command line?):
[10:58:22]anna@EdenPredator:~/$ phpcs /home/anna/Projects/GetTheGallop/wp-content/themes/hoxton-storefront/functions.php
.
Time: 30ms; Memory: 4Mb
Yeah its a prob with phpcs... `$ phpcs --report=json test.php E
{"totals":{"errors":18,"warnings":0,"fixable":14},"files":...`
I believe if you upgrade it to version 3, it should work.
[Enter steps to reproduce:]
Atom: 1.17.2 x64 Electron: 1.3.15 OS: Ubuntu 17.04 Thrown From: atom-phpcs package 1.7.3
Stack Trace
Uncaught SyntaxError: Unexpected token u in JSON at position 1
Commands
Non-Core Packages