Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from ernilambar/master
Browse files Browse the repository at this point in the history
Update from original
  • Loading branch information
dingo-d authored Apr 16, 2017
2 parents 501f2ed + 012a4a3 commit 392f707
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion inc/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function ns_theme_check_initialize_sniff() {
}

if ( isset( $_POST['hide_warning'] ) && 'true' === $_POST['hide_warning'] ) {
$args['show_warnings'] = 0;
$args['show_warnings'] = true;
}

if ( isset( $_POST['raw_output'] ) && 'true' === $_POST['raw_output'] ) {
Expand Down
12 changes: 7 additions & 5 deletions inc/checks.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function ns_theme_check_do_sniff( $theme_slug, $args = array(), $file ) {
require_once NS_THEME_CHECK_DIR . '/vendor/autoload.php';

$defaults = array(
'show_warnings' => 1,
'show_warnings' => false,
'raw_output' => 0,
'minimum_php_version' => '5.2',
'standard' => array(),
Expand Down Expand Up @@ -54,8 +54,10 @@ function ns_theme_check_do_sniff( $theme_slug, $args = array(), $file ) {
// Ignoring warnings when generating the exit code.
$cli_args .= ' --runtime-set ignore_warnings_on_exit 1';

// Show only warnings?
$cli_args .= ' --runtime-set show_warnings ' . absint( $args['show_warnings'] );
// Show only errors?
if ( $args['show_warnings'] ) {
$cli_args .= ' -n';
}

// Ignore unrelated files from the check.
$cli_args .= ' --ignore=.*/node_modules/.*';
Expand Down Expand Up @@ -101,7 +103,7 @@ function ns_theme_check_do_sniff( $theme_slug, $args = array(), $file ) {
'line' => 1,
'column' => 1,
'fixable' => false,
)
),
),
),
),
Expand All @@ -113,7 +115,7 @@ function ns_theme_check_do_sniff( $theme_slug, $args = array(), $file ) {
if ( ! empty( $output ) ) {
return ns_theme_check_render_json_report( $output );
}
}
} // End if().

}

Expand Down

0 comments on commit 392f707

Please sign in to comment.