Skip to content

Commit

Permalink
Code style: Change namespace, Use PSR 2, PSR4 and WordPress coding st…
Browse files Browse the repository at this point in the history
…andard
  • Loading branch information
tangrufus committed Mar 25, 2017
1 parent 2718d0f commit 73dcb68
Show file tree
Hide file tree
Showing 83 changed files with 2,538 additions and 2,292 deletions.
5 changes: 1 addition & 4 deletions .stickler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
linters:
phpcs:
standard: 'WordPress'

files:
ignore: ['assets/*', 'tests/*', 'vendor/*']
standard: './ruleset.xml'
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
preset: psr2
138 changes: 69 additions & 69 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,91 +3,91 @@
*
* A simplified OOP implementation of the WP Settings API.
*
* @package WP_Better_Settings
* @package TypistTech\WPBetterSettings
* @author Typist Tech <[email protected]>
* @copyright 2017 Typist Tech
* @license GPL-2.0+
* @see https://www.typist.tech/projects/wp-better-settings
* @see https://github.com/TypistTech/wp-better-settings
*/

module.exports = function ( grunt ) {
module.exports = function (grunt) {

'use strict';
'use strict';

// Project configuration.
grunt.initConfig( {
// Project configuration.
grunt.initConfig({

pkg: grunt.file.readJSON( 'package.json' ),
pkg: grunt.file.readJSON('package.json'),

// Bump version numbers.
version: {
composer: {
options: {
prefix: '"version"\\:\\s+"'
},
src: ['composer.json']
},
changelog: {
options: {
prefix: 'future-release='
},
src: ['.github_changelog_generator']
},
php: {
options: {
prefix: '\\* Version:\\s+'
},
src: ['<%= pkg.name %>.php']
}
},
// Bump version numbers.
version: {
composer: {
options: {
prefix: '"version"\\:\\s+"'
},
src: ['composer.json']
},
changelog: {
options: {
prefix: 'future-release='
},
src: ['.github_changelog_generator']
},
php: {
options: {
prefix: '\\* Version:\\s+'
},
src: ['<%= pkg.name %>.php']
}
},

// Clean the build folder.
clean: {
"pre-build": {
src: [
'build/',
'release/',
'vendor/'
]
}
},
// Clean the build folder.
clean: {
"pre-build": {
src: [
'build/',
'release/',
'vendor/'
]
}
},

// Copy to build folder.
copy: {
build: {
expand: true,
src: [
'partials/**',
'src/**',
'vendor/**',
'class-plugin.php',
'LICENSE',
'<%= pkg.name %>.php'
],
dest: 'build/'
}
},
// Copy to build folder.
copy: {
build: {
expand: true,
src: [
'partials/**',
'src/**',
'vendor/**',
'class-plugin.php',
'LICENSE',
'<%= pkg.name %>.php'
],
dest: 'build/'
}
},

compress: {
build: {
options: {
archive: 'release/<%= pkg.name %>.zip'
},
expand: true,
dest: '<%= pkg.name %>/',
cwd: 'build/',
src: ['**']
}
}
compress: {
build: {
options: {
archive: 'release/<%= pkg.name %>.zip'
},
expand: true,
dest: '<%= pkg.name %>/',
cwd: 'build/',
src: ['**']
}
}

} );
});

require( 'load-grunt-tasks' )( grunt );
grunt.registerTask( 'pre-build', ['clean:pre-build'] );
grunt.registerTask( 'build', ['copy:build', 'compress:build'] );
grunt.registerTask( 'pre-tag', ['version'] );
require('load-grunt-tasks')(grunt);
grunt.registerTask('pre-build', ['clean:pre-build']);
grunt.registerTask('build', ['copy:build', 'compress:build']);
grunt.registerTask('pre-tag', ['version']);

grunt.util.linefeed = '\n';
grunt.util.linefeed = '\n';

};
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/TypistTech/wp-better-settings/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/TypistTech/wp-better-settings/?branch=master)
[![codecov](https://codecov.io/gh/TypistTech/wp-better-settings/branch/master/graph/badge.svg)](https://codecov.io/gh/TypistTech/wp-better-settings)
[![PHP Versions Tested](http://php-eye.com/badge/typisttech/wp-better-settings/tested.svg)](https://travis-ci.org/TypistTech/wp-better-settings)
[![StyleCI](https://styleci.io/repos/81945222/shield?branch=master)](https://styleci.io/repos/81945222)
[![Dependency Status](https://gemnasium.com/badges/github.com/TypistTech/wp-better-settings.svg)](https://gemnasium.com/github.com/TypistTech/wp-better-settings)
[![Latest Unstable Version](https://poser.pugx.org/typisttech/wp-better-settings/v/unstable)](https://packagist.org/packages/typisttech/wp-better-settings)
[![License](https://poser.pugx.org/typisttech/wp-better-settings/license)](https://packagist.org/packages/typisttech/wp-better-settings)
Expand All @@ -21,4 +22,4 @@ A simplified OOP implementation of the WP Settings API.

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## To be continued..
## To be continued..
Loading

0 comments on commit 73dcb68

Please sign in to comment.