Skip to content

Commit

Permalink
[TASK] Make extension compatible to cart v6.3
Browse files Browse the repository at this point in the history
Resolves: extcode#14
  • Loading branch information
extcode committed Mar 18, 2019
1 parent 93e051c commit 26c2a35
Show file tree
Hide file tree
Showing 53 changed files with 1,463 additions and 1,296 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/Build/ export-ignore
/.gitattributes export-ignore
/.gitlab-ci.yml export-ignore
/.travis.yml export-ignore
60 changes: 52 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,64 @@
cache:
key: "$CI_COMMIT_REF_NAME/$CI_JOB_STAGE"
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- .composer/
- .php_cs.cache

variables:
COMPOSER_CACHE_DIR: ".composer"
TYPO3_PATH_WEB: "$CI_PROJECT_DIR/.Build/Web"
MYSQL_DATABASE: "typo3"
MYSQL_ROOT_PASSWORD: "joh316"
typo3DatabaseName: "typo3"
typo3DatabaseHost: "mysql"
typo3DatabaseUsername: "root"
typo3DatabasePassword: "joh316"

before_script:
- apk add git --update

stages:
- test
- lint

lint:cgl:
image: composer:1.6
stage: lint
before_script:
- composer remove typo3/cms-core --no-update
- composer install --no-progress --no-ansi --no-interaction
script:
- .Build/bin/php-cs-fixer fix --config=Build/.php_cs.dist -v --dry-run --using-cache=no --path-mode=intersection ./

lint:typoscriptcgl:
stage: lint
image: composer:1.6
script:
- composer remove typo3/cms-core --no-update
- composer install --no-progress --no-ansi --no-interaction
- .Build/bin/typoscript-lint -c tslint.yaml

test:cgl:
image: composer:1.3
stage: test
lint:yaml:
stage: lint
image: python:alpine3.7
before_script:
- composer remove typo3/cms-core --no-update
- composer install
- pip install yamllint==1.10.0
script:
- yamllint -c Build/yamllint.yaml Configuration/ Resources/ .travis.yml

lint:php70:
stage: lint
image: php:7.0-alpine
script:
- find . -name \*.php -exec php -l "{}" \;

lint:php71:
stage: lint
image: php:7.1-alpine
script:
- find . -name \*.php -exec php -l "{}" \;

lint:php72:
stage: lint
image: php:7.2-alpine
script:
- .Build/bin/php-cs-fixer fix --config=Build/.php_cs -v --dry-run --using-cache=no --path-mode=intersection
- find . -name \*.php -exec php -l "{}" \;
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
language: php

sudo: false

matrix:
fast_finish: true
include:
- php: 7.2
env: TYPO3_VERSION=^8.7
- php: 7.1
env: TYPO3_VERSION=^8.7
- php: 7
env: TYPO3_VERSION=^8.7

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

addons:
apt:
packages:
- parallel

notifications:
email:
- [email protected]

before_install:
- echo $TRAVIS_PHP_VERSION
- if php -i | grep -q xdebug; then phpenv config-rm xdebug.ini; fi
- composer self-update
- composer --version

before_script:
- composer require typo3/cms=$TYPO3_VERSION
- git checkout composer.json
- export TYPO3_PATH_WEB="$PWD/.Build/Web"

script:

- >
echo;
echo "Running php lint";
find . -name \*.php ! -path "./.Build/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;
- >
echo;
echo "Running php-cs-fixer";
.Build/bin/php-cs-fixer fix --config=Build/.php_cs -v --dry-run --using-cache=no --path-mode=intersection ./;
15 changes: 12 additions & 3 deletions Build/.php_cs → Build/.php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/../');

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
Expand All @@ -20,6 +19,7 @@ return PhpCsFixer\Config::create()
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
Expand All @@ -36,4 +36,13 @@ return PhpCsFixer\Config::create()
'phpdoc_no_empty_return' => true,
'phpdoc_trim' => true
])
->setFinder($finder);
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__ . '/../')
->exclude('.Build')
->exclude('Documentation')
->exclude('Resources')
->notName('ext_emconf.php')
->notName('ext_localconf.php')
->notName('ext_tables.php')
);
23 changes: 23 additions & 0 deletions Build/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
extends: default

rules:
line-length: disable
document-start: disable
braces:
min-spaces-inside-empty: 1
max-spaces-inside-empty: 1
brackets:
min-spaces-inside-empty: 1
max-spaces-inside-empty: 1
comments:
level: error
min-spaces-from-content: 1
comments-indentation:
level: error
empty-lines:
max: 1
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
indentation:
spaces: 2
56 changes: 0 additions & 56 deletions ChangeLog

This file was deleted.

Loading

0 comments on commit 26c2a35

Please sign in to comment.