Skip to content

Commit

Permalink
Merge pull request #29 from mundschenk-at/develop
Browse files Browse the repository at this point in the history
Maintenance (=> 3.2.0-alpha.1)
  • Loading branch information
mundschenk-at authored Feb 19, 2018
2 parents 0f079b9 + 9927b17 commit 99adc49
Show file tree
Hide file tree
Showing 34 changed files with 1,385 additions and 1,825 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# tmp files
*~

# Eclipse
.project
.settings/*
# Composer
vendor/*
composer.lock


# Node.js/Grunt
node_modules/*
package-lock.json

# grunt-wp-deploy
build/*
Expand Down
7 changes: 3 additions & 4 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"excludeFiles": [
"admin/js/**/*.min.js",
"public/js/**/*.min.js",
"**/js/tinymce4/media-credit-tinymce-switch.js",
"**/js/tinymce4/media-credit-tinymce.js",
"**/js/tinymce4/tinymce-noneditable.js",
"Gruntfile.js"
"vendor/**/*.js",
"**/js/tinymce4/tinymce-noneditable.js",
"Gruntfile.js"
]
}
3 changes: 2 additions & 1 deletion .jshintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/js/**.min.js
admin/js/tinymce4/*.js
admin/js/tinymce4/tinymce-noneditable.js
node_modules/**/*.js
build/**/*.js
vendor/**/*.js
Gruntfile.js
46 changes: 46 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
filter:
paths:
- 'includes/*'
- 'admin/*'
- 'public/*'
- 'media-credit.php'

dependency_paths:
- wordpress/

excluded_paths:
- 'js/*.min.js'

build:
cache:
directories:
- ~/.composer # Composer home directory (avoid fetching already fetched packages)
# vendor is already included.

environment:
rabbitmq: false
mysql: false
postgresql: false
mongodb: false
elasticsearch: false
redis: false
memcached: false
neo4j: false
php:
version: 7.1
tests:
override:
- phpcs-run -p media-credit.php includes/ admin/ public/ --extensions=php
nodes:
analysis:
project_setup:
override: true
dependencies:
before:
- composer require --dev johnpbloch/wordpress
tests:
override: [php-scrutinizer-run]
tools:
php_code_sniffer: false
php_cs_fixer: false
external_code_coverage: false
107 changes: 55 additions & 52 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Travis CI (MIT License) configuration file for the Media Credit WordPress plugin.
# Travis CI (MIT License) configuration file.
# @link https://travis-ci.org/

# For use with the Media Credit WordPress plugin.
Expand All @@ -13,6 +13,11 @@ sudo: false
# @link http://about.travis-ci.org/docs/user/languages/php/
language: php

# Cache composer stuff
cache:
directories:
- $HOME/.composer/cache

# Declare versions of PHP to use. Use one decimal max.
# @link http://docs.travis-ci.com/user/build-configuration/
matrix:
Expand All @@ -21,75 +26,73 @@ matrix:
include:
# Current $required_php_version for WordPress: 5.2.4
# aliased to 5.2.17
- php: '5.2'
env: CHECKING_PHP52=1
# aliased to 5.3.29
- php: '5.3'
# aliased to a recent 5.6.x version
- php: '5.6'
# aliased to a recent 7.x version
- php: '7.0'
env: SNIFF=1
- php: '5.2'
dist: precise
env: SCOPE=php52
# minimum version for activating wp-Typography 5.6.0, aliased to a recent 5.6.x version
- php: '5.6'
env: SCOPE=none
# aliased to a recent 7.0 version
- php: '7.0'
env: SCOPE=none
# aliased to a recent 7.1 version
- php: '7.1'
# aliased to a recent hhvm version
- php: 'hhvm'

allow_failures:
- php: 'hhvm'
env: SCOPE=none
# aliased to a recent 7.2 version
- php: '7.2'
env: SCOPE=phpcs

# Use this to prepare the system to install prerequisites or dependencies.
# e.g. sudo apt-get update.
# Failures in this section will result in build status 'errored'.
# before_install:
before_install:
- if [[ "$SCOPE" == "tests" || "$SCOPE" == "coverage" ]]; then
composer install --no-interaction --dev;
phpenv rehash;
fi
- if [[ "$SCOPE" == "phpcs" ]]; then
composer install --no-interaction --dev;
phpenv rehash;
npm install -g jscs;
npm install -g jshint;
fi
- if [[ "$SCOPE" == "coverage" ]]; then composer require php-coveralls/php-coveralls --dev; fi

# Use this to prepare your build for testing.
# e.g. copy database configurations, environment variables, etc.
# Failures in this section will result in build status 'errored'.
before_script:
- export PHPCS_DIR=/tmp/phpcs
- export SNIFFS_DIR=/tmp/sniffs
# Install CodeSniffer for WordPress Coding Standards checks.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
# Install WordPress Coding Standards.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_DIR; fi
# Install PHP Compatibility sniffs.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_DIR/PHPCompatibility; fi
# Set install path for PHPCS sniffs.
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs --config-set installed_paths $SNIFFS_DIR; fi
# After CodeSniffer install you should refresh your path.
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
# Install JSCS: JavaScript Code Style checker.
# @link http://jscs.info/
- if [[ "$SNIFF" == "1" ]]; then npm install -g jscs; fi
# Install JSHint, a JavaScript Code Quality Tool.
# @link http://jshint.com/docs/
- if [[ "$SNIFF" == "1" ]]; then npm install -g jshint; fi
# Pull in the WP Core jshint rules.
- if [[ "$SNIFF" == "1" ]]; then wget https://develop.svn.wordpress.org/trunk/.jshintrc; fi

# Run test script commands.
# Default is specific to project language.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
# Search for PHP syntax errors.
- find -L . -not \( -path ./tests -prune \) -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# Run the theme through JSHint.
- if [[ "$SNIFF" == "1" ]]; then jshint .; fi
# Run the theme through JavaScript Code Style checker.
- if [[ "$SNIFF" == "1" ]]; then jscs .; fi
- if [[ "$SCOPE" == "php52" ]]; then
find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l;
else
find -L . -not \( -path ./tests -prune \) -not \( -path ./vendor -prune \) -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l;
fi
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
# -p flag: Show progress of the run.
# -s flag: Show sniff codes in all reports.
# -v flag: Print verbose output.
# -n flag: Do not print warnings. (shortcut for --warning-severity=0)
# --standard: Use WordPress as the standard.
# --extensions: Only sniff PHP files.
# --ignore: Don't check non-WP files
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./phpcs.xml --extensions=php --ignore=build/*,node_modules/*,tests/*,vendor/*,php-typography/*/*,php-typography/_language_names.php; fi
- if [[ "$SCOPE" == "phpcs" ]]; then
composer phpcs;
jshint .;
jscs .;
fi
# Unit tests.
- if [[ "$SCOPE" == "tests" ]]; then composer test; fi
# Code coverage
- if [[ "$SCOPE" == "coverage" ]]; then
mkdir -p build/logs;
composer test -- --coverage-clover build/logs/clover.xml;
fi

after_script:
- if [[ "$SCOPE" == "coverage" ]]; then
php vendor/bin/coveralls -v;
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml;
fi

# Receive notifications for build results.
# @link http://docs.travis-ci.com/user/notifications/#Email-notifications
Expand Down
Loading

0 comments on commit 99adc49

Please sign in to comment.