-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from wmde/maintenance-2023
Maintenance 2023
- Loading branch information
Showing
12 changed files
with
121 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# See the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "composer" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Dependabot auto-approve | ||
on: pull_request | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Approve a PR | ||
run: gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
*~ | ||
!.* | ||
.idea/ | ||
|
||
composer.phar | ||
composer.lock | ||
|
||
vendor/ | ||
|
||
.idea/ | ||
.phpunit.result.cache | ||
.phpunit.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,37 @@ | ||
# If the first argument is "composer"... | ||
ifeq (composer,$(firstword $(MAKECMDGOALS))) | ||
# use the rest as arguments for "composer" | ||
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
# ...and turn them into do-nothing targets | ||
$(eval $(RUN_ARGS):;@:) | ||
endif | ||
current_user := $(shell id -u) | ||
current_group := $(shell id -g) | ||
|
||
.PHONY: ci test phpunit cs stan covers composer | ||
BUILD_DIR := $(PWD) | ||
COMPOSER_FLAGS := | ||
DOCKER_FLAGS := --interactive --tty | ||
DOCKER_IMAGE := registry.gitlab.com/fun-tech/fundraising-frontend-docker | ||
|
||
.PHONY: ci test phpunit cs stan composer | ||
|
||
ci: test cs | ||
|
||
test: covers phpunit | ||
test: phpunit | ||
|
||
cs: phpcs stan | ||
|
||
install-php: install | ||
|
||
install: | ||
docker run --rm $(DOCKER_FLAGS) --volume $(BUILD_DIR):/app -w /app --volume /tmp:/tmp --volume ~/.composer:/composer --user $(current_user):$(current_group) $(DOCKER_IMAGE):composer composer install $(COMPOSER_FLAGS) | ||
|
||
update-php: update | ||
|
||
update: | ||
docker run --rm $(DOCKER_FLAGS) --volume $(BUILD_DIR):/app -w /app --volume /tmp:/tmp --volume ~/.composer:/composer --user $(current_user):$(current_group) $(DOCKER_IMAGE):composer composer update $(COMPOSER_FLAGS) | ||
|
||
phpunit: | ||
docker-compose run --rm email-address ./vendor/bin/phpunit | ||
docker-compose run --rm app ./vendor/bin/phpunit | ||
|
||
phpcs: | ||
docker-compose run --rm email-address ./vendor/bin/phpcs | ||
docker-compose run --rm app ./vendor/bin/phpcs | ||
|
||
stan: | ||
docker-compose run --rm email-address ./vendor/bin/phpstan analyse --level=1 --no-progress src/ tests/ | ||
|
||
covers: | ||
docker-compose run --rm email-address ./vendor/bin/covers-validator | ||
docker-compose run --rm app ./vendor/bin/phpstan analyse --level=9 --no-progress src/ tests/ | ||
|
||
composer: | ||
docker run --rm --interactive --tty --volume $(shell pwd):/app -w /app\ | ||
--volume ~/.composer:/composer --user $(shell id -u):$(shell id -g) composer composer $(filter-out $@,$(MAKECMDGOALS)) | ||
fix-cs: | ||
docker-compose run --rm app ./vendor/bin/phpcbf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
version: '2' | ||
|
||
services: | ||
email-address: | ||
app: | ||
volumes: | ||
- ./:/usr/src/app | ||
working_dir: /usr/src/app | ||
image: wikimediade/fundraising-frontend:latest | ||
|
||
|
||
image: registry.gitlab.com/fun-tech/fundraising-frontend-docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,173 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml | ||
- https://github.com/squizlabs/PHP_CodeSniffer/tree/master/src/Standards | ||
--> | ||
<ruleset name="WikimediaDeutschlandStyle"> | ||
|
||
<ruleset> | ||
<file>src/</file> | ||
<file>tests/</file> | ||
|
||
<arg name="extensions" value="php"/> | ||
<arg value="s"/> | ||
<arg value="p"/> | ||
|
||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki/Sniffs/WhiteSpace"> | ||
<exclude name="vendor/mediawiki/mediawiki-codesniffer/MediaWiki/Sniffs/WhiteSpace/SpaceBeforeSingleLineCommentSniff.php" /> | ||
</rule> | ||
|
||
<rule ref="Generic.Arrays.DisallowLongArraySyntax" /> | ||
<rule ref="Generic.Classes" /> | ||
<rule ref="Generic.CodeAnalysis"> | ||
<exclude name="Generic.CodeAnalysis.EmptyStatement" /> | ||
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter" /> | ||
</rule> | ||
<rule ref="Generic.ControlStructures" /> | ||
|
||
<rule ref="Generic.Files.ByteOrderMark" /> | ||
<rule ref="Generic.Files.LineEndings" /> | ||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<!-- https://github.com/squizlabs/PHP_CodeSniffer/issues/1094 --> | ||
<property name="lineLimit" value="170" /> | ||
<property name="absoluteLineLimit" value="170" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Formatting.DisallowMultipleStatements" /> | ||
|
||
<rule ref="Generic.Functions.CallTimePassByReference" /> | ||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" /> | ||
|
||
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" /> | ||
|
||
<rule ref="Generic.Metrics.NestingLevel"> | ||
<properties> | ||
<property name="nestingLevel" value="3" /> | ||
<property name="absoluteNestingLevel" value="3" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.Metrics.CyclomaticComplexity"> | ||
<properties> | ||
<property name="complexity" value="10" /> | ||
<property name="absoluteComplexity" value="10" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Generic.NamingConventions" /> | ||
<!-- TODO: create variation of this sniff that allows underscores in test methods --> | ||
<rule ref="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps"> | ||
<!-- Exclude test methods like "testGivenInvalidInput_methodThrowsException". --> | ||
<exclude-pattern>*Test\.php</exclude-pattern> | ||
</rule> | ||
|
||
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" /> | ||
<rule ref="Generic.PHP.DeprecatedFunctions" /> | ||
<rule ref="Generic.PHP.DisallowShortOpenTag" /> | ||
<rule ref="Generic.PHP.ForbiddenFunctions" /> | ||
<rule ref="Generic.PHP.LowerCaseConstant" /> | ||
<rule ref="Generic.PHP.LowerCaseKeyword" /> | ||
<rule ref="Generic.PHP.SAPIUsage" /> | ||
|
||
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" /> | ||
|
||
<rule ref="PSR1" /> | ||
<!-- TODO: create variation of this sniff that allows underscores in test methods --> | ||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> | ||
<!-- Exclude test methods like "testGivenInvalidInput_methodThrowsException". --> | ||
<exclude-pattern>*Test\.php</exclude-pattern> | ||
</rule> | ||
|
||
<rule ref="PSR2.Classes.PropertyDeclaration" /> | ||
<rule ref="PSR2.ControlStructures.ElseIfDeclaration" /> | ||
<rule ref="PSR2.Namespaces" /> | ||
|
||
<rule ref="Squiz.Arrays.ArrayBracketSpacing" /> | ||
<rule ref="Squiz.CSS.SemicolonSpacing" /> | ||
<rule ref="Squiz.Classes.DuplicateProperty" /> | ||
<rule ref="Squiz.Classes.SelfMemberReference" /> | ||
<rule ref="Squiz.Classes.ValidClassName" /> | ||
<rule ref="Squiz.Functions.FunctionDuplicateArgument" /> | ||
<rule ref="Squiz.Functions.GlobalFunction" /> | ||
<rule ref="Squiz.Scope" /> | ||
|
||
<rule ref="Squiz.Strings.DoubleQuoteUsage" /> | ||
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> | ||
<severity>0</severity> | ||
</rule> | ||
|
||
<rule ref="Squiz.WhiteSpace.CastSpacing" /> | ||
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" /> | ||
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing" /> | ||
|
||
<rule ref="Squiz.WhiteSpace.OperatorSpacing"> | ||
<properties> | ||
<property name="ignoreNewlines" value="true" /> | ||
</properties> | ||
<exclude name="Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore" /> | ||
<exclude name="Squiz.WhiteSpace.OperatorSpacing.NoSpaceAfter" /> | ||
</rule> | ||
|
||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace" /> | ||
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing" /> | ||
<rule ref="Squiz.WhiteSpace.SemicolonSpacing" /> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" /> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines"> | ||
<severity>0</severity> | ||
</rule> | ||
|
||
<rule ref="Zend.Files.ClosingTag" /> | ||
|
||
<!-- MediaWiki.WhiteSpace.SpaceyParenthesis replica for up-to-date codesniffer version --> | ||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> | ||
<properties> | ||
<property name="equalsSpacing" value="1" /> | ||
<property name="requiredSpacesAfterOpen" value="1" /> | ||
<property name="requiredSpacesBeforeClose" value="1" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="PEAR.Functions.FunctionCallSignature"> | ||
<properties> | ||
<property name="requiredSpacesAfterOpen" value="1" /> | ||
<property name="requiredSpacesBeforeClose" value="1" /> | ||
</properties> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" /> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" /> | ||
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" /> | ||
</rule> | ||
|
||
<!-- Using 3rd party sniff while Squiz isn't there, yet. https://github.com/squizlabs/PHP_CodeSniffer/issues/911 --> | ||
<rule ref="./vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php" /> | ||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> | ||
<properties> | ||
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2" /> | ||
<property name="spacesCountAroundEqualsSign" value="1" /> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="./vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php" /> | ||
|
||
<rule ref="./vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/TypeHintDeclarationSniff.php"> | ||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification" /> | ||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification" /> | ||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification" /> | ||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingPropertyTypeHint" /> | ||
</rule> | ||
|
||
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"> | ||
<properties> | ||
<property name="usefulAnnotations" type="array" value=" | ||
@see, | ||
@throws, | ||
@dataProvider, | ||
@slowThreshold, | ||
@noinspection | ||
"/> | ||
<property name="enableVoidTypeHint" value="false" /> | ||
</properties> | ||
</rule> | ||
<arg name="encoding" value="UTF-8"/> | ||
<arg value="p" /> | ||
<arg value="s" /> | ||
|
||
<rule ref="./vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php" /> | ||
<rule ref="./vendor/wmde/fundraising-phpcs/WMDE/Fundraising"/> | ||
</ruleset> |
Oops, something went wrong.