diff --git a/.travis.yml b/.travis.yml index 0c1f055..1301117 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,3 +31,8 @@ script: echo; echo "Linting all PHP files"; composer ci:php:lint; + +- > + echo; + echo "Linting all TypoScript files"; + composer ci:ts:lint; diff --git a/Configuration/TsLint.yml b/Configuration/TsLint.yml new file mode 100644 index 0000000..471605e --- /dev/null +++ b/Configuration/TsLint.yml @@ -0,0 +1,16 @@ +sniffs: + - class: Indentation + parameters: + useSpaces: true + indentPerLevel: 4 + indentConditions: true + - class: DeadCode + - class: OperatorWhitespace + - class: RepeatingRValue + disabled: true + - class: DuplicateAssignment + - class: EmptySection + disabled: true + - class: NestingConsistency + parameters: + commonPathPrefixThreshold: 1 diff --git a/Configuration/TypoScript/.gitkeep b/Configuration/TypoScript/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Configuration/TypoScript/constants.txt b/Configuration/TypoScript/constants.txt new file mode 100644 index 0000000..2869866 --- /dev/null +++ b/Configuration/TypoScript/constants.txt @@ -0,0 +1,21 @@ +plugin.tx_tea { + view { + # cat=plugin.tx_tea/file; type=string; label=Path to template root (FE) + templateRootPath = EXT:tea/Resources/Private/Templates/ + # cat=plugin.tx_tea/file; type=string; label=Path to template partials (FE) + partialRootPath = EXT:tea/Resources/Private/Partials/ + # cat=plugin.tx_tea/file; type=string; label=Path to template layouts (FE) + layoutRootPath = EXT:tea/Resources/Private/Layouts/ + } + + persistence { + # cat=plugin.tx_tea//a; type=string; label=Default storage PID + storagePid = + # cat=plugin.tx_tea//a; type=int; label=UID of the page/folder where all new records will be created + newRecordStoragePid = + } + + settings { + + } +} diff --git a/Configuration/TypoScript/setup.txt b/Configuration/TypoScript/setup.txt new file mode 100644 index 0000000..9311b59 --- /dev/null +++ b/Configuration/TypoScript/setup.txt @@ -0,0 +1,15 @@ +plugin.tx_tea { + view { + templateRootPath = {$plugin.tx_tea.view.templateRootPath} + partialRootPath = {$plugin.tx_tea.view.partialRootPath} + layoutRootPath = {$plugin.tx_tea.view.layoutRootPath} + } + + persistence { + storagePid = {$plugin.tx_tea.persistence.storagePid} + } + + settings { + + } +} diff --git a/composer.json b/composer.json index 505cd53..ec00f79 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,9 @@ "typo3/cms-frontend": "^7.6.23 || ^8.7.9" }, "require-dev": { - "nimut/testing-framework": "^2.0.0", "helhum/typo3-composer-setup": "^0.5.1", + "helmich/typo3-typoscript-lint": "^1.4.4", + "nimut/testing-framework": "^2.0.0", "phpunit/phpunit": "^5.7.0", "mikey179/vfsStream": "^1.6.0", "roave/security-advisories": "dev-master" @@ -63,8 +64,10 @@ }, "scripts": { "ci:php:lint": "find *.php Classes/ Configuration/ Tests/ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l", + "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript/", "ci:static": [ - "@ci:php:lint" + "@ci:php:lint", + "@ci:ts:lint" ], "ci": [ "@ci:static"