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

Commit

Permalink
1.1.2 Release
Browse files Browse the repository at this point in the history
* Updated packages
* Remove check only PHP option
* Remove JS sniff and minor style fix
* Update callback to sniff only PHP and remove test folder in theme if exists
  * Added regex check for node modules, vendor and test folders in the theme, and remove them prior to sniffing to avoid memory issues.
* Update version number
  • Loading branch information
dingo-d committed Mar 30, 2020
1 parent e723132 commit 3aadb8c
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 274 deletions.
3 changes: 1 addition & 2 deletions assets/dev/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ $(
const warningHide = $( 'input[name=hide_warning]' ).is( ':checked' );
const outputRaw = $( 'input[name=raw_output]' ).is( ':checked' );
const ignoreAnnotations = $( 'input[name=ignore_annotations]' ).is( ':checked' );
const checkPhpOnly = $( 'input[name=check_php_only]' ).is( ':checked' );
const minPHPVersion = $( 'select[name=minimum_php_version]' ).val();
const themePrefixes = $( 'input[name=theme_prefixes]' ).val();

const selectedRulesets = $( 'input[name="selected_ruleset[]"]:checked' ).map( ( ind, el ) => el.value ).toArray();

themeSniffer.enableAjax();
themeSniffer.themeCheckRunPHPCS( theme, warningHide, outputRaw, ignoreAnnotations, checkPhpOnly, minPHPVersion, selectedRulesets, themePrefixes );
themeSniffer.themeCheckRunPHPCS( theme, warningHide, outputRaw, ignoreAnnotations, minPHPVersion, selectedRulesets, themePrefixes );
}
);

Expand Down
8 changes: 1 addition & 7 deletions assets/dev/scripts/theme-sniffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import $ from 'jquery';
import {ajax} from './utils/ajax';

import Clipboard from 'clipboard';
import SniffJs from './utils/sniff-js';

export default class ThemeSniffer {
constructor( options ) {
Expand Down Expand Up @@ -170,14 +169,13 @@ export default class ThemeSniffer {
}
}

themeCheckRunPHPCS( theme, warningHide, outputRaw, ignoreAnnotations, checkPhpOnly, minPHPVersion, selectedRulesets, themePrefixes ) {
themeCheckRunPHPCS( theme, warningHide, outputRaw, ignoreAnnotations, minPHPVersion, selectedRulesets, themePrefixes ) {

const snifferRunData = {
themeName: theme,
hideWarning: warningHide,
rawOutput: outputRaw,
ignoreAnnotations: ignoreAnnotations,
checkPhpOnly: checkPhpOnly,
minimumPHPVersion: minPHPVersion,
wpRulesets: selectedRulesets,
themePrefixes: themePrefixes,
Expand Down Expand Up @@ -217,10 +215,6 @@ export default class ThemeSniffer {

for ( let file of response.files ) {
( async() => {
if ( file.filePath.substr( file.filePath.length - 3 ) === '.js' ) {
let sniffer = new SniffJs( file );
file = await sniffer.process();
}
this.$sniffReport.append( this.renderJSON( file ) );
})( file );
}
Expand Down
1 change: 1 addition & 0 deletions assets/dev/styles/components/_admin-screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

&::before {
font-size: 32px !important;
margin: 0.2125rem 0 0 0.05rem !important;
}
}

Expand Down
Loading

0 comments on commit 3aadb8c

Please sign in to comment.