Skip to content

Commit 0345ff5

Browse files
author
vishalkakadiya
committed
Add configuration files
1 parent d6ee9c1 commit 0345ff5

24 files changed

+2199
-141
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
; Uncomment to enable this extension.
2+
; zend_extension=xdebug.so
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
; Uncomment to enable this extension.
2+
zend_extension=xdebug.so

.scrutinizer.yml

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
coding_style:
2+
php:
3+
indentation:
4+
general:
5+
use_tabs: true
6+
size: 3
7+
switch:
8+
indent_case: true
9+
spaces:
10+
general:
11+
linefeed_character: newline
12+
before_parentheses:
13+
function_declaration: false
14+
closure_definition: false
15+
function_call: false
16+
if: true
17+
for: true
18+
while: true
19+
switch: true
20+
catch: true
21+
array_initializer: false
22+
around_operators:
23+
assignment: true
24+
logical: true
25+
equality: true
26+
relational: true
27+
bitwise: true
28+
additive: true
29+
multiplicative: true
30+
shift: true
31+
unary_additive: false
32+
concatenation: true
33+
negation: true
34+
before_left_brace:
35+
class: true
36+
function: true
37+
if: true
38+
else: true
39+
for: true
40+
while: true
41+
do: true
42+
switch: true
43+
try: true
44+
catch: true
45+
finally: true
46+
before_keywords:
47+
else: true
48+
while: true
49+
catch: true
50+
finally: true
51+
within:
52+
brackets: true
53+
array_initializer: true
54+
grouping: true
55+
function_call: true
56+
function_declaration: true
57+
if: true
58+
for: true
59+
while: true
60+
switch: true
61+
catch: true
62+
type_cast: false
63+
ternary_operator:
64+
before_condition: true
65+
after_condition: true
66+
before_alternative: true
67+
after_alternative: true
68+
in_short_version: false
69+
other:
70+
before_comma: false
71+
after_comma: true
72+
before_semicolon: false
73+
after_semicolon: true
74+
after_type_cast: true
75+
braces:
76+
classes_functions:
77+
class: end-of-line
78+
function: end-of-line
79+
closure: end-of-line
80+
if:
81+
opening: end-of-line
82+
always: true
83+
else_on_new_line: false
84+
for:
85+
opening: end-of-line
86+
always: true
87+
while:
88+
opening: end-of-line
89+
always: true
90+
do_while:
91+
opening: end-of-line
92+
always: true
93+
while_on_new_line: false
94+
switch:
95+
opening: end-of-line
96+
try:
97+
opening: end-of-line
98+
catch_on_new_line: false
99+
finally_on_new_line: false
100+
upper_lower_casing:
101+
keywords:
102+
general: lower
103+
constants:
104+
true_false_null: lower
105+
106+
tools:
107+
php_sim: true
108+
php_pdepend: true
109+
php_analyzer: true
110+
external_code_coverage:
111+
timeout: 600 # Timeout in seconds.
112+
113+
filter:
114+
excluded_paths:
115+
- 'tests/'
116+
dependency_paths:
117+
- wordpress/
118+
119+
checks:
120+
php:
121+
unreachable_code: true
122+
simplify_boolean_return: true
123+
return_in_constructor: true
124+
code_rating: true
125+
duplication: true
126+
127+
build:
128+
nodes:
129+
analysis:
130+
tests:
131+
override:
132+
- php-scrutinizer-run
133+
dependencies:
134+
before:
135+
- composer require --dev johnpbloch/wordpress

.travis.yml

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sudo: false
2+
dist: trusty
23

34
language: php
45

@@ -9,24 +10,27 @@ notifications:
910

1011
branches:
1112
only:
12-
- main
13+
- master
14+
- develop
1315

14-
php:
15-
- 5.6
16+
cache:
17+
directories:
18+
- vendor
19+
- $HOME/.composer/cache
1620

1721
matrix:
1822
include:
19-
- php: 5.6
23+
- php: 7.3
2024
env: WP_VERSION=latest
25+
- php: 7.2
26+
env: WP_VERSION=latest
27+
- php: 7.3
28+
env: WP_VERSION=trunk
29+
- php: 7.2
30+
env: WP_VERSION=trunk
31+
- php: 7.2
32+
env: WP_TRAVISCI=phpcs
2133

22-
before_script:
23-
- export PATH="$HOME/.composer/vendor/bin:$PATH"
24-
- composer global require "phpunit/phpunit=4.8.*|5.7.*"
25-
- docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit phpdbg -qrr /usr/local/bin/phpunit -c /app/phpunit.xml --coverage-clover=/app/clover.xml --coverage-html=/app/coverage
26-
27-
script:
28-
- phpunit --coverage-text --coverage-clover=coverage.cloverphpunit
34+
script: ./bin/run-wp-unit-tests.sh
2935

30-
after_script:
31-
- wget https://scrutinizer-ci.com/ocular.phar
32-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
36+
after_script: ./bin/after-run-wp-unit-tests.sh

Gruntfile.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
'use strict';
2+
module.exports = function ( grunt ) {
3+
4+
grunt.initConfig( {
5+
// Make POT file - Internationalize WordPress plugins.
6+
// Ref. https://www.npmjs.com/package/grunt-wp-i18n
7+
makepot: {
8+
plugin: {
9+
options: {
10+
cwd: './', // Directory of files to internationalize.
11+
domainPath: 'languages/', // Where to save the POT file.
12+
exclude: [ 'node_modules/*', '.phpintel/*' ], // List of files or directories to ignore.
13+
mainFile: 'wp-comment-preview.php', // Main project file.
14+
potFilename: 'comment-preview.pot', // Name of the POT file.
15+
potHeaders: { // Headers to add to the generated POT file.
16+
poedit: true, // Includes common Poedit headers.
17+
'Last-Translator': 'Vishal Kakadiya <[email protected]>',
18+
'Language-Team': 'Dev',
19+
'report-msgid-bugs-to': 'https://github.com/vishalkakadiya/comment-preview/issues',
20+
'x-poedit-keywordslist': true, // Include a list of all possible gettext functions.
21+
},
22+
type: 'wp-plugin', // Type of project (wp-plugin or wp-theme).
23+
updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
24+
},
25+
},
26+
},
27+
28+
} );
29+
30+
grunt.loadNpmTasks( 'grunt-wp-i18n' );
31+
32+
// Register task
33+
grunt.registerTask( 'default', [ 'makepot' ] );
34+
};

0 commit comments

Comments
 (0)