Skip to content

Commit

Permalink
[TODO] Adding lints and automatic deployment system to TER
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsan-technologies committed Nov 30, 2019
1 parent be8b3b5 commit e521af3
Show file tree
Hide file tree
Showing 11 changed files with 302 additions and 18 deletions.
76 changes: 76 additions & 0 deletions .editorconfig
@@ -0,0 +1,76 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# CSS-Files
[*.css]
indent_style = space
indent_size = 4

# HTML-Files
[*.html]
indent_style = space
indent_size = 4

# TMPL-Files
[*.tmpl]
indent_style = space
indent_size = 4

# TSX-Files
[*.tsx]
indent_style = space
indent_size = 4

# LESS-Files
[*.less]
indent_style = space
indent_size = 4

# JS-Files
[*.js]
indent_style = space
indent_size = 4

# PHP-Files
[*.php]
indent_style = space
indent_size = 4

# MD-Files
[*.md]
indent_style = space
indent_size = 4

# ReST-Files
[*.rst]
indent_style = space
indent_size = 3

# TypoScript
[*.typoscript,*.ts]
indent_style = space
indent_size = 4

# YML-Files
[{*.yml,*.yaml}]
indent_style = space
indent_size = 2

# package.json, composer.json or .travis.yml
[{package.json,composer.json,.travis.yml}]
indent_style = space
indent_size = 2

# SCSS
[*.scss]
indent_style = tab
indent_size = 2
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.git
76 changes: 76 additions & 0 deletions .gitlab-ci.yml
@@ -0,0 +1,76 @@
cache:
key: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE"
paths:
- .composer/

before_script:
- apk add git --update

stages:
- php
- typoscript
- yaml
#- fluid
#- xliff

.php: &phptesting
stage: php
image: php:$DOCKER_TAG
only:
- branches
before_script:
- export TYPO3_PATH_WEB="$PWD/.Build/Web"
- export COMPOSER_CACHE_DIR=.composer
- curl -OLs https://composer.github.io/installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php --no-ansi --install-dir=/usr/bin --filename=composer
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- composer require friendsofphp/php-cs-fixer
script:
- .Build/bin/php-cs-fixer fix --dry-run --config=.php_cs --diff

# Tests in PHP 7.2 and TYPO3 9.5 version
php:testphp72:typo3_95:
<<: *phptesting
variables:
DOCKER_TAG: 7.2-alpine
# TYPO3_VERSION: ^9.5

typoscript:test:
image: composer:1.6
stage: typoscript
before_script:
- export COMPOSER_CACHE_DIR=.composer
- composer require --dev helmich/typo3-typoscript-lint
script:
- .Build/bin/typoscript-lint -c tslint.yaml

yaml:test:
image: python:alpine3.7
stage: yaml
before_script:
- pip install yamllint==1.10.0
script:
- yamllint -c .yamllint .

#fluid:test:
# image: composer:1.6
# stage: fluid
# before_script:
# - export COMPOSER_CACHE_DIR=.composer
# - composer require typo3fluid/fluid-lint:dev-master
# script:
# - .Build/bin/fluidlint Resources/Private/Templates/Default.html

#xliff:test:
# image: composer:1.6
# stage: xliff
# before_script:
# - export COMPOSER_CACHE_DIR=.composer
# #- apk --no-cache add libxml2-utils
# #- wget https://raw.githubusercontent.com/symfony/translation/v4.1.1/Resources/schemas/xliff-core-1.0-strict.xsd
# - composer require symfony/translation
# script:
# - .Build/bin/xlifflint /usr/local/bin/php lint:xliff /Resources/Private/Language
# #- xmllint --schema xliff-core-1.0-strict.xsd --noout $(find Resources -name '*.xlf')
58 changes: 58 additions & 0 deletions .php_cs
@@ -0,0 +1,58 @@
<?php
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ php-cs-fixer fix
*
* For more information read:
* http://www.php-fig.org/psr/psr-2/
* http://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'general_phpdoc_annotation_remove' => [
'author'
],
'no_leading_import_slash' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'concat_space' => ['spacing' => 'one'],
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'single_quote' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
'no_leading_namespace_whitespace' => true,
'native_function_casing' => true,
'self_accessor' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('.build')
->exclude('var')
//->exclude('public')
->in(__DIR__)
);
33 changes: 33 additions & 0 deletions .travis.yml
@@ -0,0 +1,33 @@
language: php

php:
- 7.2

#env:
# - TYPO3_VERSON="9.5"

sudo: false

notifications:
email: false

addons:
apt:
packages:
- parallel

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

before_script:
#- composer require typo3/minimal ${TYPO3_VERSON} --update-with-dependencies
#- composer require nimut/testing-framework
- composer require friendsofphp/php-cs-fixer
- composer require --dev helmich/typo3-typoscript-lint
- pip install yamllint==1.10.0

script:
- .Build/bin/php-cs-fixer fix --dry-run --config=.php_cs --diff
- .Build/bin/typoscript-lint -c tslint.yaml
- yamllint -c .yamllint .
35 changes: 35 additions & 0 deletions .yamllint
@@ -0,0 +1,35 @@
---

extends: default

rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
colons:
level: warning
commas:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
spaces: 2
level: warning
indent-sequences: consistent
line-length: disable
line-length:
max: 999
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable

ignore: |
/.ddev/
6 changes: 4 additions & 2 deletions README.md
@@ -1,2 +1,4 @@
# [NITSAN] Guestbook
https://extensions.typo3.org/extension/ns_guestbook/
# ns_guestbook

- FREE version: You can download FREE version with basic-features at https://extensions.typo3.org/extension/ns_guestbook/
- PRO version: You can download PRO version with more-features & free-support at https://t3terminal.com/typo3-guestbook-plugin-free/
3 changes: 1 addition & 2 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "nitsan/ns-guestbook",
"type": "typo3-cms-extension",
"description": "One of the only TYPO3 extension which provides to integrate all the features of Guestbook like review form with send mail, list of guest. Know more from extension manual.",
"description": "One of the only TYPO3 extension which provides to integrate all the features of Guestbook like review form with send mail, list of guest. Know more from extension manual. You can download PRO version for more-features & free-support at https://t3terminal.com/typo3-guestbook-plugin-free/",
"homepage": "https://extensions.typo3.org/extension/ns_guestbook/",
"license": "GPL-2.0+",
"keywords": [
Expand All @@ -25,7 +25,6 @@
}
},
"replace": {
"ns_guestbook": "self.version",
"nitsan/ns-guestbook": "self.version"
},
"extra": {
Expand Down
18 changes: 4 additions & 14 deletions ext_emconf.php
@@ -1,28 +1,18 @@
<?php

/***************************************************************
* Extension Manager/Repository config file for ext: "ns_guestbook"
*
* Auto generated by Extension Builder 2018-06-06
*
* Manual updates:
* Only the data in the array - anything else is removed by next write.
* "version" and "dependencies" must not be touched!
***************************************************************/

$EM_CONF[$_EXTKEY] = array(
'title' => '[NITSAN] Guestbook',
'description' => 'One of the only TYPO3 extension which provides to integrate all the features of Guestbook like review form with send mail, list of guest. Know more from extension manual.',
'title' => '[NITSAN] Guestbook TYPO3 Plugin',
'description' => 'One of the only TYPO3 extension which provides to integrate all the features of Guestbook like review form with send mail, list of guest. Demo: https://demo.t3terminal.com/t3t-extensions/guestbook/ You can download PRO version for more-features & free-support at https://t3terminal.com/typo3-guestbook-plugin-free/',
'category' => 'plugin',
'author' => 'T3:Milan Rathod, T3:Keval Pandya, FE:Mehul Nimavat, QA:Siddharth Sheth ',
'author' => 'T3:Milan Rathod, T3:Keval Pandya, FE:Mehul Nimavat, QA:Siddharth Sheth',
'author_email' => 'sanjay@nitsan.in',
'author_company' => 'NITSAN Technologies Pvt Ltd',
'state' => 'stable',
'internal' => '',
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 0,
'version' => '1.0.1',
'version' => '1.1.0',
'constraints' => array(
'depends' => array(
'typo3' => '6.0.0-9.5.99',
Expand Down
Empty file modified ext_icon.gif 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tslint.yaml
@@ -0,0 +1,14 @@
paths:
- Configuration

filePatterns:
- "*.ts"

sniffs:
- class: Indentation
parameters:
indentConditions: true
- class: RepeatingRValue
disabled: true
- class: DeadCode
disabled: true

1 comment on commit e521af3

@NamelessCoder
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • NamelessCoder\GizzleGitPlugins\GizzlePlugins\ClonePlugin:00000000144ff285000000001620a566:
    • 0: Executing Git clone command: /usr/bin/git clone --depth 1 --single-branch --branch '1.1.0' 'https://github.com/nitsan-technologies/ns_guestbook.git' /tmp/e521af3334741a8896c1ea1f859787e0461035a1/ns_guestbook
    • NamelessCoder\TYPO3RepositoryGizzle\GizzlePlugins\ExtensionRepositoryReleasePlugin:00000000144ff29b000000001620a566:
      • resultCode: 10504
      • resultMessages:
        • 0: Please note that it might take a while (up to an hour) until your extension and the documentation appear on TYPO3.org.
        • version: 1.1.0

Please sign in to comment.