Commit 0fb8845b authored by Luke081515's avatar Luke081515

Initial commit

parents
Pipeline #941 passed with stages
in 1 minute and 43 seconds
stages:
- lint
- codesniffer
lint:lint-php5.4:
stage: lint
image: php:5.4
before_script:
- bash ci/docker_install.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php5.6:
stage: lint
image: php:5.6
before_script:
- bash ci/docker_install.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php7.0:
stage: lint
image: php:7.0
before_script:
- bash ci/docker_install.sh > /dev/null
script:
- bash ci/phplint.sh ./
lint:lint-php7.1:
stage: lint
image: php:7.1
before_script:
- bash ci/docker_install.sh > /dev/null
script:
- bash ci/phplint.sh ./
codesniffer:
stage: codesniffer
image: php:5.6
before_script:
- bash ci/docker_install.sh > /dev/null
script:
- bash ci/phpcs.sh
allow_failure: true
[submodule "Cygnus"]
path = Cygnus
url = https://gitlab.wmflabs.org/Cygnus/Cygnus.git
Subproject commit 23cb4ebdc5e34f4a9720d4adb4b7793a49912025
This diff is collapsed.
These are small scripts which are quickly written and used for some normally boring tasks. Use them on your own risk.
\ 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
# Install phpunit, the tool that we will use for testing
curl --location --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
chmod +x /usr/local/bin/phpunit
# Install mysql driver
# Here you can install any other extension that you need
docker-php-ext-install pdo_mysql
\ No newline at end of file
#!/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
\ No newline at end of file
<?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.ForLoopWithTestFunctionCall"/>
<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.DiscouragedFunctions"/>
<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>
\ No newline at end of file
<?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