Skip to content

Commit

Permalink
Merge pull request #13 from YouweGit/feature/split-grumphp-config-tem…
Browse files Browse the repository at this point in the history
…plates

Fix installation breaking for pimcore-project types
  • Loading branch information
Anve94 committed Nov 17, 2022
2 parents f683233 + cd929ac commit a53b4a1
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.16.0
### Fixed
- Testing suite no longer breaks during installation when composer project type is set to `pimcore-project`.

### Added
- `phpcs.xml`, `phpmd.xml` and `phpstan.neon` files are now automatically installed in a local `pimcore-project` if they don't exist yet.

## 2.15.0
### Added
- Project type resolver can now look for pimcore projects.
Expand Down
16 changes: 16 additions & 0 deletions templates/files/pimcore/phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<ruleset name="PHPCS"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPCS</description>

<!--<exclude-pattern type="relative">^/path/to/exclude/*</exclude-pattern>-->

<!-- @TODO: Offload to separate coding-standard-pimcore package, and add common pimcore conventions there -->
<rule ref="Youwe"/>

<!-- Append arg -s to phpcs to display the name of failed sniffs -->
<arg value="s"/>
</ruleset>
58 changes: 58 additions & 0 deletions templates/files/pimcore/phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<ruleset name="PHPMD"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPMD</description>
<!-- @TODO: Offload to separate coding-standard-pimcore package, and add common pimcore conventions there -->

<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->

<!-- Taken from Global ruleset since we can't modify a referenced rule without overwriting it completely.
See: https://github.com/phpmd/phpmd/issues/39 -->
<rule ref="rulesets/cleancode.xml">
<exclude name="ElseExpression"/>
<exclude name="StaticAccess"/>
<exclude name="BooleanArgumentFlag"/>
</rule>

<rule ref="rulesets/codesize.xml"/>

<rule ref="rulesets/design.xml">
<exclude name="CouplingBetweenObjects"/>
</rule>

<rule ref="rulesets/design.xml/CouplingBetweenObjects">
<properties>
<property name="maximum" value="20"/>
</properties>
</rule>

<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
<exclude name="LongVariable"/>
<exclude name="ShortClassName"/>
<exclude name="LongClassName"/>
<exclude name="ShortMethodName" />
</rule>

<rule ref="rulesets/naming.xml/LongVariable">
<properties>
<property name="maximum" value="30"/>
</properties>
</rule>

<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter"/>
<exclude name="UnusedLocalVariable"/>
</rule>
<!-- End of global ruleset -->

<!-- Global rule extension to allow 'up' function name for migrations -->
<rule ref="rulesets/naming.xml/ShortMethodName">
<properties>
<property name="exceptions" value="up" />
</properties>
</rule>
</ruleset>
3 changes: 3 additions & 0 deletions templates/files/pimcore/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
excludes_analyse:
# - %rootDir%/../../../path/to/exclude/*
3 changes: 3 additions & 0 deletions templates/mapping/project/pimcore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{pimcore/,}phpcs.xml
{pimcore/,}phpmd.xml
{pimcore/,}phpstan.neon

0 comments on commit a53b4a1

Please sign in to comment.