Browse Source

Fix up stan-setup.

mscherer 3 years ago
parent
commit
b5e630f99e
5 changed files with 25 additions and 14 deletions
  1. 3 0
      .editorconfig
  2. 11 9
      .github/CONTRIBUTING.md
  3. 1 0
      .gitignore
  4. 5 0
      .phive/phars.xml
  5. 5 5
      composer.json

+ 3 - 0
.editorconfig

@@ -16,6 +16,9 @@ end_of_line = crlf
 [*.yml]
 indent_size = 2
 
+[phars.xml]
+indent_size = 2
+
 [Makefile]
 indent_style = tab
 

+ 11 - 9
.github/CONTRIBUTING.md

@@ -25,11 +25,11 @@ Help us keep CakePHP open and inclusive. Please read and follow our [Code of Con
 ## Making Changes
 
 * Create a topic branch from where you want to base your work.
-  * This is usually the current default branch - `4.x` right now.
-  * To quickly create a topic branch based on `4.x`
-    `git branch 4.x/my_contribution 4.x` then checkout the new branch with `git
-    checkout 4.x/my_contribution`. Better avoid working directly on the
-    `4.x` branch, to avoid conflicts if you pull in updates from origin.
+  * This is usually the current default branch - `5.x` right now.
+  * To quickly create a topic branch based on `5.x`
+    `git branch 5.x/my_contribution 5.x` then checkout the new branch with `git
+    checkout 5.x/my_contribution`. Better avoid working directly on the
+    `5.x` branch, to avoid conflicts if you pull in updates from origin.
 * Make commits of logical units.
 * Check for unnecessary whitespace with `git diff --check` before committing.
 * Use descriptive commit messages and reference the #issue number.
@@ -38,8 +38,8 @@ Help us keep CakePHP open and inclusive. Please read and follow our [Code of Con
 
 ## Which branch to base the work
 
-* Bugfix branches will be based on the current default branch - `4.x` right now.
-* New features that are **backwards compatible** will be based on the appropriate `next` branch. For example if you want to contribute to the next 4.x branch, you should base your changes on `4.next`.
+* Bugfix branches will be based on the current default branch - `5.x` right now.
+* New features that are **backwards compatible** will be based on the appropriate `next` branch. For example if you want to contribute to the next 5.x branch, you should base your changes on `5.next`.
 * New features or other **non backwards compatible** changes will go in the next major release branch.
 
 ## What is "backwards compatible" (BC)
@@ -76,11 +76,13 @@ Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
 repository to set up the CakePHP standard. The [README](https://github.com/cakephp/cakephp-codesniffer/blob/master/README.md) contains installation info
 for the sniff and phpcs.
 
-To run static analysis tools [PHPStan](https://github.com/phpstan/phpstan) and [Psalm](https://github.com/vimeo/psalm) you first have to install the additional packages via:
+To run static analysis tools [PHPStan](https://github.com/phpstan/phpstan) and [Psalm](https://github.com/vimeo/psalm) you first have to install the additional packages via [phive](https://phar.io/).
 
     composer stan-setup
 
-And after that perform the checks via:
+The currently used PHPStan and Psalm versions can be found in [Phive config](.phive/phars.xml).
+
+After that you can perform the checks via:
 
     composer stan
 

+ 1 - 0
.gitignore

@@ -6,6 +6,7 @@
 /composer.lock
 /phpunit.xml
 /phpstan.neon
+/tools
 /vendor
 /vendors
 /composer.phar

+ 5 - 0
.phive/phars.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phive xmlns="https://phar.io/phive">
+  <phar name="phpstan" version="1.9.12" installed="1.9.12" location="./tools/phpstan" copy="false"/>
+  <phar name="psalm" version="5.4.0" installed="5.4.0" location="./tools/psalm" copy="false"/>
+</phive>

+ 5 - 5
composer.json

@@ -107,15 +107,15 @@
         ],
         "cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
         "cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
-        "phpstan": "phpstan.phar analyse",
-        "psalm": "psalm.phar --show-info=false",
+        "phpstan": "tools/phpstan analyse",
+        "psalm": "tools/psalm --show-info=false",
         "stan": [
             "@phpstan",
             "@psalm"
         ],
-        "stan-tests": "phpstan.phar analyze -c tests/phpstan.neon",
-        "stan-baseline": "phpstan.phar --generate-baseline",
-        "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.9.0 psalm/phar:~5.4.0 && mv composer.backup composer.json",
+        "stan-tests": "tools/phpstan analyze -c tests/phpstan.neon",
+        "stan-baseline": "tools/phpstan --generate-baseline",
+        "stan-setup": "phive install",
         "lowest": "validate-prefer-lowest",
         "lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json",
         "test": "phpunit",