Skip to content

Commit 9c48c47

Browse files
stian-overasenPetter Walbø Johnsgård
authored andcommitted
New module registration, add Dekode Coding Standards (#38)
* Update module registration * Set core requirement >=1.1.7 * Version bump to 1.1.8 * Add changelog for 1.1.8 * Add Dekode Coding Standards * Update travis config
1 parent e1ce461 commit 9c48c47

File tree

6 files changed

+350
-86
lines changed

6 files changed

+350
-86
lines changed

.travis.yml

Lines changed: 39 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,52 @@
1-
# Travis CI configuration file for Hogan.
2-
# @link https://travis-ci.org/
3-
4-
# Ditch sudo and use containers.
5-
# @link https://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F
6-
# @link https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
71
sudo: false
82
dist: trusty
93

10-
# Declare versions of PHP to use. Use one decimal max.
11-
# @link https://docs.travis-ci.com/user/build-configuration/
4+
cache:
5+
directories:
6+
- $HOME/.composer/cache
7+
128
matrix:
13-
fast_finish: true
9+
include:
10+
- language: php
11+
php: 7.2
12+
env: WP_TRAVISCI=phpcs
1413

15-
include:
16-
# PHP 7.0.x
17-
- language: php
18-
php: '7.0'
19-
env:
20-
- SNIFF="1"
21-
- LINT="0"
14+
- language: php
15+
php: 7.1
16+
env: WP_TRAVISCI=phpcs
2217

23-
# PHP 7.2.x
24-
- language: php
25-
php: '7.2'
26-
env:
27-
- SNIFF="1"
28-
- LINT="0"
18+
- language: php
19+
php: 7.0
20+
env: WP_TRAVISCI=phpcs
2921

30-
# Node.js / Linting
31-
- language: node_js
32-
node_js: 8
33-
env:
34-
- SNIFF="0"
35-
- LINT="1"
22+
- language: node_js
23+
node_js: 8
24+
env: WP_TRAVISCI=node
3625

37-
# Use this to prepare your build for testing.
38-
# Failures in this section will result in build status 'errored'.
3926
before_script:
40-
- export PHPCS_DIR=/tmp/phpcs
41-
- export SNIFFS_WPCS_DIR=/tmp/sniffs_wpcs
42-
- export SNIFFS_PHPCOMPATIBILITY_DIR=/tmp/sniffs_phpcompataibility
43-
# Install CodeSniffer for WordPress Coding Standards checks.
44-
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
45-
# Install WordPress Coding Standards.
46-
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $SNIFFS_WPCS_DIR; fi
47-
# Install PHP Compatibility.
48-
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $SNIFFS_PHPCOMPATIBILITY_DIR; fi
49-
# Set install path for PHPCS sniffs.
50-
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $SNIFFS_WPCS_DIR,$SNIFFS_PHPCOMPATIBILITY_DIR; fi
51-
# After CodeSniffer install you should refresh your path.
52-
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
53-
# Install node packages.
54-
- if [[ "$LINT" == "1" ]]; then yarn install; fi
27+
- if [[ "$WP_TRAVISCI" == "phpcs" ]]; then export PATH="$HOME/.composer/vendor/bin:$PATH"; fi
28+
- |
29+
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
30+
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
31+
phpenv config-rm xdebug.ini
32+
else
33+
echo "xdebug.ini does not exist"
34+
fi
35+
fi
36+
- |
37+
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
38+
composer install
39+
fi
40+
- if [[ "$WP_TRAVISCI" == "node" ]]; then yarn install; fi
5541

56-
# Run test script commands.
57-
# Default is specific to project language.
58-
# All commands must exit with code 0 on success. Anything else is considered failure.
5942
script:
60-
# Search for PHP syntax errors.
61-
- if [[ "$SNIFF" == "1" ]]; then find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
62-
# WordPress Coding Standards.
63-
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
64-
# @link https://pear.php.net/package/PHP_CodeSniffer/
65-
# Uses a custom ruleset based on WordPress.
66-
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --runtime-set testVersion $TRAVIS_PHP_VERSION; fi
67-
- if [[ "$LINT" == "1" ]]; then yarn lint; fi
43+
- |
44+
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
45+
find . -name '*.php' ! -path "./vendor/*" ! -path "./wp-content/*" -print0 | xargs -0 -n 1 -P 4 php -l
46+
echo Running phpcs for PHP version $TRAVIS_PHP_VERSION …
47+
./vendor/bin/phpcs --runtime-set testVersion $TRAVIS_PHP_VERSION
48+
fi
49+
- if [[ "$WP_TRAVISCI" == "node" ]]; then yarn lint; fi
6850

69-
# Receive notifications for build results.
70-
# @link https://docs.travis-ci.com/user/notifications/#Email-notifications
7151
notifications:
72-
email: false
52+
email: false

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.1.8
4+
- Update module to new registration method introduced in [Hogan Core 1.1.7](https://github.com/DekodeInteraktiv/hogan-core/releases/tag/1.1.7)
5+
- Set hogan-core dependency `"dekodeinteraktiv/hogan-core": ">=1.1.7"`
6+
- Add Dekode Coding Standards
7+
38
## 1.1.7
49
- Fixed a fatal type error bug when no cards is selected backend. [#36](https://github.com/DekodeInteraktiv/hogan-grid/issues/36)
510
- Added classname `.hogan-grid-has-theme` to all sections that have a theme. [#34](https://github.com/DekodeInteraktiv/hogan-grid/issues/34)

composer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"require": {
88
"php": ">=7.0",
99
"composer/installers": "~1.2",
10-
"dekodeinteraktiv/hogan-core": "^1.0.11"
10+
"dekodeinteraktiv/hogan-core": ">=1.1.7"
1111
},
1212
"archive": {
1313
"exclude": [
@@ -20,5 +20,14 @@
2020
"package.json",
2121
"yarn.lock"
2222
]
23+
},
24+
"require-dev": {
25+
"dekodeinteraktiv/coding-standards": "^0.3.1"
26+
},
27+
"scripts": {
28+
"test" : [
29+
"@composer install",
30+
"./vendor/bin/phpcs"
31+
]
2332
}
2433
}

0 commit comments

Comments
 (0)