Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
crstauf authored Apr 13, 2020
1 parent 2dca381 commit 0c97c40
Show file tree
Hide file tree
Showing 30 changed files with 4,933 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
trim_trailing_whitespace = true

[*.yml]
indent_size = 2
indent_style = space
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/report
49 changes: 49 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>

<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.3-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>

<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress">
<exclude name="WordPress.VIP"/>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
</ruleset>
58 changes: 58 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
dist: trusty

language: php

os: linux

notifications:
email:
on_success: never
on_failure: change

branches:
only:
- master

cache:
directories:
- $HOME/.composer/cache

php:
- 7.1.18
- 7.2.29
- 7.3.16

env:
- WP_VERSION=5.4 WP_MULTISITE=0
- WP_VERSION=5.4 WP_MULTISITE=1
- WP_VERSION=5.3 WP_MULTISITE=0
- WP_VERSION=5.3 WP_MULTISITE=1
- WP_VERSION=5.2 WP_MULTISITE=0
- WP_VERSION=5.2 WP_MULTISITE=1
- WP_VERSION=5.1 WP_MULTISITE=0
- WP_VERSION=5.1 WP_MULTISITE=1

before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
phpenv config-rm xdebug.ini
else
echo "xdebug.ini does not exist"
fi
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=7.5.*"
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
fi
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit
fi
Loading

0 comments on commit 0c97c40

Please sign in to comment.