Gruntfile.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 93
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 57
mnd 0
bc 0
fnc 1
dl 0
loc 93
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
/* jshint node:true */
2
module.exports = function( grunt ) {
3
	require( 'load-grunt-tasks' )( grunt );
4
5
	// Project configuration.
6
	grunt.initConfig( {
7
		pkg: grunt.file.readJSON( 'package.json' ),
8
9
		// PHPLint
10
		phplint: {
11
			core: [
12
				'src/**/*.php'
13
			]
14
		},
15
16
		// PHP Code Sniffer
17
		phpcs: {
18
			core: {
19
				src: [
20
					'src/**/*.php',
21
					'tests/src/**/*.php'
22
				]
23
			},
24
			options: {
25
				bin: 'vendor/bin/phpcs',
26
				standard: 'phpcs.xml.dist',
27
				showSniffCodes: true
28
			}
29
		},
30
31
		// PHPUnit
32
		phpunit: {
33
			options: {
34
				bin: 'vendor/bin/phpunit'
35
			},
36
			classes: {
37
				
38
			}
39
		},
40
		
41
		// Check text domain errors
42
		checktextdomain: {
43
			options:{
44
				text_domain: 'pronamic-money',
45
				keywords: [
46
					'__:1,2d',
47
					'_e:1,2d',
48
					'_x:1,2c,3d',
49
					'esc_html__:1,2d',
50
					'esc_html_e:1,2d',
51
					'esc_html_x:1,2c,3d',
52
					'esc_attr__:1,2d',
53
					'esc_attr_e:1,2d',
54
					'esc_attr_x:1,2c,3d',
55
					'_ex:1,2c,3d',
56
					'_n:1,2,4d',
57
					'_nx:1,2,4c,5d',
58
					'_n_noop:1,2,3d',
59
					'_nx_noop:1,2,3c,4d'
60
				]
61
			},
62
			files: {
63
				src:  [
64
					'src/**/*.php'
65
				],
66
				expand: true
67
			}
68
		},
69
70
		// Make POT
71
		makepot: {
72
			target: {
73
				options: {
74
					domainPath: 'languages',
75
					type: 'wp-plugin',
76
					mainFile: 'pronamic-money.php',
77
					updatePoFiles: true,
78
					updateTimestamp: false,
79
					exclude: [
80
						'vendor/.*',
81
						'wordpress/.*'
82
					],
83
					include: [
84
						'src/.*'
85
					]
86
				}
87
			}
88
		}
89
	} );
90
91
	// Default task(s).
92
	grunt.registerTask( 'default', [ 'phplint', 'phpcs', 'phpunit' ] );
93
	grunt.registerTask( 'pot', [ 'checktextdomain', 'makepot' ] );
94
};
95