1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
Commit Graph

60 Commits

Author SHA1 Message Date
kkmuffme
881546340c fix tests running with other than called PHP binary if called with a non-default PHP binary
e.g. you run the tests with a php83 executable but your default php is PHP 7.4, it will suddenly change while running the tests leading to false positive errors
2024-03-19 13:26:25 +01:00
kkmuffme
47c52ad602 fix /src/psalm.xml not removed between tests and remove psalm.xml at the end of tests 2024-02-01 20:11:06 +01:00
Roland Franssen :)
039c526c58
Update PsalmRunnerTrait.php 2023-07-01 16:47:42 +02:00
Roland Franssen :)
06172740cd
Update PsalmRunnerTrait.php 2023-07-01 13:40:04 +02:00
Roland Franssen :)
f0e2856963
Update PsalmRunnerTrait.php 2023-07-01 13:36:42 +02:00
Roland Franssen :)
7cf87b28dc
Update PsalmRunnerTrait.php 2023-07-01 13:28:05 +02:00
orklah
8e636086b3
put config to true to prevent deprecations for new config files (#9857)
* put config to true to prevent deprecations for new config files
2023-06-19 22:02:29 +02:00
kkmuffme
51fd63cfbb fix CI warnings 2023-06-13 16:59:25 +02:00
kkmuffme
40679e9a82 fix failing mock tests 2023-06-07 08:12:31 +02:00
Alies Lapatsin
c55d297d0a Fix coding style issue 2023-01-29 18:52:09 +01:00
Alies Lapatsin
7526d60f2a Update assertion to reflect a new output
It reverts 588d9e08bc (diff-1ef46093f20172c4dc1cbe5a54e5b60c255082acd3f7c382dae621d8d23df404R172)
2023-01-29 18:32:31 +01:00
Bruce Weirdan
2af7f51394
Suppress warnings when --no-output is specified 2023-01-22 20:40:21 -04:00
Jack Worman
1c19260cdd Require trailing commas 2022-12-18 13:20:31 -06:00
Jack Worman
a52f35e5e1 Even more property typehints 2022-12-16 13:24:21 -06:00
Jack Worman
69658e8315 SlevomatCodingStandard.Commenting.DocCommentSpacing 2022-12-14 13:34:41 -06:00
Matthew Brown
8d36bdc3ed
Make array shapes strict by default (#8701)
* Make array shapes strict by default

* Fix PSL tests
2022-11-11 20:14:21 -05:00
1986c8b4a8
Add support for strict arrays, fix type alias intersection, fix array_is_list assertion on non-lists (#8395)
* Immutable CodeLocation

* Remove excess clones

* Remove external clones

* Remove leftover clones

* Fix final clone issue

* Immutable storages

* Refactoring

* Fixes

* Fixes

* Fix

* Fix

* Fixes

* Simplify

* Fixes

* Fix

* Fixes

* Update

* Fix

* Cache global types

* Fix

* Update

* Update

* Fixes

* Fixes

* Refactor

* Fixes

* Fix

* Fix

* More caching

* Fix

* Fix

* Update

* Update

* Fix

* Fixes

* Update

* Refactor

* Update

* Fixes

* Break one more test

* Fix

* FIx

* Fix

* Fix

* Fix

* Fix

* Improve performance and readability

* Equivalent logic

* Fixes

* Revert

* Revert "Revert"

This reverts commit f9175100c8452c80559234200663fd4c4f4dd889.

* Fix

* Fix reference bug

* Make default TypeVisitor immutable

* Bugfix

* Remove clones

* Partial refactoring

* Refactoring

* Fixes

* Fix

* Fixes

* Fixes

* cs-fix

* Fix final bugs

* Add test

* Misc fixes

* Update

* Fixes

* Experiment with removing different property

* revert "Experiment with removing different property"

This reverts commit ac1156e077fc4ea633530d51096d27b6e88bfdf9.

* Uniform naming

* Uniform naming

* Hack hotfix

* Clean up $_FILES ref #8621

* Undo hack, try fixing properly

* Helper method

* Remove redundant call

* Partially fix bugs

* Cleanup

* Change defaults

* Fix bug

* Fix (?, hope this doesn't break anything else)

* cs-fix

* Review fixes

* Bugfix

* Bugfix

* Improve logic

* Add support for list{} and callable-list{} types, properly implement array_is_list assertions (fixes #8389)

* Default to sealed arrays

* Fix array_merge bug

* Fixes

* Fix

* Sealed type checks

* Properly infer properties-of and get_object_vars on final classes

* Fix array_map zipping

* Fix tests

* Fixes

* Fixes

* Fix more stuff

* Recursively resolve type aliases

* Fix typo

* Fixes

* Fix array_is_list assertion on keyed array

* Add BC docs

* Fixes

* fix

* Update

* Update

* Update

* Update

* Seal arrays with count assertions

* Fix #8528

* Fix

* Update

* Improve sealed array foreach logic

* get_object_vars on template properties

* Fix sealed array assertion reconciler logic

* Improved reconciler

* Add tests

* Single source of truth for test types

* Fix tests

* Fixup tests

* Fixup tests

* Fixup tests

* Update

* Fix tests

* Fix tests

* Final fixes

* Fixes

* Use list syntax only when needed

* Fix tests

* Cs-fix

* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Document missing types

* Update docs

* Improve class-string-map docs

* Update

* Update

* I love working on psalm :)

* Keep arrays unsealed by default

* Fixup tests

* Fix syntax mistake

* cs-fix

* Fix typo

* Re-import missing types

* Keep strict types only in return types

* argc/argv fixes

* argc/argv fixes

* Fix test

* Comment-out valinor code, pinging @romm pls merge https://github.com/CuyZ/Valinor/pull/246 so we can add valinor to the psalm docs :)
2022-11-05 22:34:42 +01:00
AndrolGenhald
588d9e08bc Fix extension capitalization issue, add extensions to version message. 2022-02-03 11:34:50 -06:00
Bruce Weirdan
c81c5faa83
Drop dead code based on PHP_VERSION_ID
Psalm now requires PHP 7.4, so this test is never skipped.
2022-01-05 01:49:27 +02:00
Bruce Weirdan
094a0651d7
Increase composer timeout
This should prevent random failures we've been observing lately.
2022-01-02 07:06:16 +02:00
rarila
97e6511fab Set number of lines before and after namespace. 2021-12-15 04:58:32 +01:00
Bruce Weirdan
e9d9481ea6
Merge pull request #7060 from rarila/codingstyle-convert-fqn 2021-12-05 02:46:03 +02:00
Bruce Weirdan
14dcbc908a
Don't output console links in CI env (#7049) 2021-12-04 19:49:24 +02:00
ralila
30a65685a2 Import instead of using fqn classes 2021-12-03 21:40:18 +01:00
ralila
7c32325e03 Import instead of using fqn constants 2021-12-03 21:25:22 +01:00
ralila
2a956498bf Import instead of using fqn functions 2021-12-03 21:07:25 +01:00
Bruce Weirdan
d19aad7db1
Display target PHP version
Historically it was often not quite clear to users what PHP version
Psalm assumes, and why. This PR addresses this issue by printing the
version and where we got it from right before scanning the files.
2021-11-27 02:18:09 +02:00
orklah
e2bb9859e4 fix tests 2021-11-01 22:27:43 +01:00
Matt Brown
06b89aa00a Fix end-to-end tests 2021-06-10 18:07:41 -04:00
Matt Brown
ae1fd44b13 Resolve build issues 2021-03-22 19:37:49 -04:00
Bruce Weirdan
205fdd197e
Wrap entrypoints into IIFE to protect their variables (#5366)
* Wrap entrypoints into IIFE to protect their variables

Fixes vimeo/psalm#5359

* Add tests for Psalm variable isolation

* Capture environment before registering autoloader
2021-03-11 00:14:22 -05:00
Bruce Weirdan
0489dd1fd8
Use separate exit code to indicate Psalm finding issues (#5087)
* Use separate exit code to indicate Psalm finding issues

This will allow to distinguish successful run that found some issues
from crashes.

* Fix e2e test expectations

* Documented exit statuses
2021-01-24 13:30:35 -05:00
Adrien LUCAS
6f1f680b2d
Add option to dump taint graph (#5080)
* Add option to dump taint graph

* Fix types

* Simplify types

Co-authored-by: Matthew Brown <github@muglug.com>
2021-01-22 16:04:15 -05:00
Matt Brown
62b0ddd74d Fix test 2020-11-20 19:07:48 -05:00
Matt Brown
23ab0f1ddb Allow Psalm to run in taint analysis mode without a config 2020-11-20 19:02:44 -05:00
Matt Brown
43af3b1a57 Break out TaintedInput issues into a lot of separate ones 2020-11-17 12:44:31 -05:00
Matt Brown
9d7414cbbd Get rid of version test, which is dumb 2020-11-06 18:24:23 -05:00
Matt Brown
db4d5bca95 Fix tests 2020-10-05 10:14:39 -04:00
Bruce Weirdan
d9776aa710
Fixes crash due to class/filename mismatch (#4247)
Introduced in 56cddd16bf
2020-09-26 13:31:38 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
orklah
b19f0a7034
Remove empty() and use strict comparison when safe (#4211)
* replace empty usage with stricter checks

* use strict comparison when safe

* replace is_null with === null for consistency
2020-09-19 18:26:51 -04:00
Brown
2f82f312b2 Change version test 2020-08-30 12:44:01 -04:00
Bruce Weirdan
1cf5153700
Test parallelization (#4045)
* Run tests in random order

Being able to run tests in any order is a pre-requisite for being able
to run them in parallel.

* Reset type coverage between tests, fix affected tests

* Reset parser and lexer between test runs and on php version change

Previously lexer was reset, but parser kept the reference to the old
one, and reference to the parser was kept by StatementsProvider. This
resulted in order-dependent tests - if the parser was first initialized
with phpVersion set to 7.4 then arrow functions worked fine, but were
failing when the parser was initially constructed with settings for 7.3

This can be demonstrated on current master by upgrading to
nikic/php-parser:4.9 and running:

```
vendor/bin/phpunit --no-coverage --filter="inferredArgArrowFunction" tests/ClosureTest.php
```

Now all tests using PHP 7.4 features must set the PHP version
accordingly.

* Marked more tests using 7.4 syntax

* Reset newline-between-annotation flag between tests

* Resolve real paths before passing them to checkPaths

When checkPaths is called from psalm.php the paths are resolved, so we
just mimicking SUT behaviour here.

* Restore newline-between-annotations in DocCommentTest

* Tweak Appveyor caches

* Tweak TravisCI caches

* Tweak CircleCI caches

* Run tests in parallel

Use `vendor/bin/paratest` instead of `vendor/bin/phpunit`

* Use default paratest runner on Windows

WrapperRunner is not supported on Windows.

* TRAVIS_TAG could be empty

* Restore appveyor conditional caching
2020-08-23 10:32:07 -04:00
Bruce Weirdan
931d35a703
Collect and scan files included by the autoloaders (#3183)
Refs vimeo/psalm#2861
2020-07-11 17:17:22 -04:00
Brown
831482951a Fix things 2020-06-06 11:23:05 -04:00
Brown
376f761db4 Skip broken test 2020-06-06 10:34:49 -04:00
Brown
438eb17e58 Fix #3367 - ensure --diff works after second run, not third 2020-06-05 12:09:38 -04:00
Matthew Brown
ced092874a Make config generation smarter 2020-02-17 22:05:58 -05:00
Matthew Brown
21f36c3dbd Add slashes 2019-11-30 00:49:06 -05:00
Matthew Brown
e777f5227d Don’t run classloader test in 7.1 2019-11-30 00:46:19 -05:00