Commit f480b7e6 authored by ~rs's avatar ~rs

Merge branch 'pipeline' into 'master'

Pipeline

See merge request !1
parents 4a194169 13ccc6d8
Pipeline #1203 passed with stages
in 1 minute
stages:
- lint
- codesniffer
lint:lint-php5.4:
stage: lint
image: php:5.4
before_script:
- bash ci/docker_install-lint.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php5.6:
stage: lint
image: php:5.6
before_script:
- bash ci/docker_install-lint.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php7.0:
stage: lint
image: php:7.0
before_script:
- bash ci/docker_install-lint.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php7.1:
stage: lint
image: php:7.1
before_script:
- bash ci/docker_install-lint.sh > /dev/null
script:
- bash ci/phplint.sh ./
codesniffer:
stage: codesniffer
image: php:5.6
before_script:
- bash ci/docker_install-cs.sh > /dev/null
script:
- bash ci/phpcs.sh
allow_failure: true
\ No newline at end of file
#!/usr/bin/php
<?php
include './Core/BotCore.php';
/** AnserWikiBrowser.php
require './Core/BotCore.php';
/** AnserWikiBrowser.php
* Opens a page in a user-defined editor and let’s you do things.
* @Author KPFC
* @Author KPFC
* @Version 0.1
* @Status Alpha
*/
class AnserWikiBrowser extends Core {
public function AnserWikiBrowser ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login
*/
class AnserWikiBrowser extends Core {
public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use
$editor = $this->askOperator('Enter your favorit text editor:');
if (!$editor) {
......@@ -84,5 +84,5 @@ class AnserWikiBrowser extends Core {
unlink($page_tmp);
}
}
$Bot = new AnserWikiBrowser ('KPFC@test2wiki', 'Custom-Edit'); // Aufrufen der definierten Passwortdaten in Password.php
$Bot = new AnserWikiBrowser('KPFC@test2wiki', 'Custom-Edit'); // Aufrufen der definierten Passwortdaten in Password.php
?>
#!/usr/bin/php
<?php
include './Core/BotCore.php';
/** EditInEditor.php
require './Core/BotCore.php';
/** EditInEditor.php
* Opens a page in a user-defined editor and saves the page after closing the editor
* @Author KPFC
* @Author KPFC
* @Version 0.1
* @Status Alpha
*/
class EditInEditor extends Core {
public function EditInEditor ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS = true); //login
*/
class EditInEditor extends Core {
public function __construct ($Account, $Job, $pUseHTTPS = true) {
$this->initcurl($Account, $Job, $pUseHTTPS); //login
//ask for editor to use
// $editor = $this->askOperator('Enter your favorit text editor:');
// if (!$editor) {
......@@ -28,9 +28,9 @@ class EditInEditor extends Core {
unlink($page_tmp);
//save page
$minor = $this->askOperator('Minor? [y/N/a]:');
if (($minor==='a') || ($minor==='A')) {
if (($minor === 'a') || ($minor === 'A')) {
echo "aborted edit …\n";
} else if (($minor==='y') || ($minor==='Y') || ($minor==='yes') || ($minor==='Yes')) {
} else if (($minor === 'y') || ($minor === 'Y') || ($minor === 'yes') || ($minor === 'Yes')) {
$this->editPageMinor($pagename, $pagecontent, $this->askOperator('Edit Summary:'));
echo "saved minor edit …\n";
} else {
......@@ -38,12 +38,12 @@ class EditInEditor extends Core {
echo "saved edit …\n";
}
$continue = $this->askOperator("Continue? [y/N]");
if (($continue==='y') || ($continue==='Y') || ($continue==='yes') || ($continue==='Yes')) {
if (($continue === 'y') || ($continue === 'Y') || ($continue === 'yes') || ($continue === 'Yes')) {
$exit = false;
} else {
$exit = true;
}
}
}
}
......
#!/bin/bash
# We need to install dependencies only for Docker
[[ ! -e /.dockerenv ]] && exit 0
set -xe
# Install git (the php image doesn't have it) which is required by composer
apt-get update -yqq
apt-get install git -yqq
# Install phpcs
pear install PHP_CodeSniffer
\ No newline at end of file
#!/bin/bash
# We need to install dependencies only for Docker
[[ ! -e /.dockerenv ]] && exit 0
set -xe
# Install git (the php image doesn't have it) which is required by composer
apt-get update -yqq
apt-get install git -yqq
phpcs ./ -p --colors
#!/bin/bash
#Usage: `phplint.sh /path/to/dir` or `phplint.sh /path/to/file.php`
error=false
while test $# -gt 0; do
current=$1
shift
if [ ! -d $current ] && [ ! -f $current ] ; then
echo "Invalid directory or file: $current"
error=true
continue
fi
for file in `find $current -type f -name "*.php"` ; do
RESULTS=`php -l $file`
if [ "$RESULTS" != "No syntax errors detected in $file" ] ; then
echo $RESULTS
error=true
fi
done
done
if [ "$error" = true ] ; then
exit 1
else
exit 0
fi
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Cygnus">
<description>Codestyling rules for Cygnus.
</description>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="300"/>
<property name="absoluteLineLimit" value="400"/>
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<rule ref="Generic.NamingConventions.ConstructorName">
<properties>
<property name="error" value="false"/>
</properties>
</rule>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PEAR.Files.IncludingFile"/>
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="Squiz.PHP.DisallowMultipleAssignments"/>
<rule ref="Squiz.PHP.EmbeddedPhp"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.Heredoc"/>
<rule ref="Squiz.PHP.InnerFunctions"/>
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</ruleset>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Cygnus">
<arg name="tab-width" value="4" />
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="tabIndent" value="true"/>
</properties>
</rule>
</ruleset>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment