1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
Commit Graph

41 Commits

Author SHA1 Message Date
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01:00
ralila
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +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
Bruce Weirdan
76be96ce53
Drop FakeFileProvider from tests folder
And use Psalm\Internal\Provider\FakeFileProvider
2021-07-02 03:57:57 +03:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
Joe Hoyle
ba43e6d0f3
Remove file map cache when re-analyzing files (#5084)
* Remove file map cache when re-analyzing files

When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.

In doing this I had to write a few more tests to check my assumptions too, so adding those additional tests.

* Rename test

* Formatting

* Formatting again!
2021-01-22 16:05:28 -05:00
Brown
ea08e0c613 Fix test result 2020-09-25 08:42:27 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
Brown
941643ca59 Fix tests 2020-09-19 17:04:35 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
orklah
f66d57f19d
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2020-09-04 16:26:33 -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
Brown
370ffa28e4 Fix #3117 - invalidate all caches when composer lockfile changes 2020-04-12 11:41:37 -04:00
Brown
031c5be8e6 Check trait methods better 2020-03-27 00:37:33 -04:00
Brown
ceebc9e81d Only invalidate methods that call a removed trait 2020-03-02 15:26:57 -05:00
Matthew Brown
0050d1f4d7
Change key 2020-03-02 12:27:23 -05:00
Brown
6b96286d2c Add another test that should work 2020-03-02 11:44:54 -05:00
Brown
7b2d9eeab7 Add some tests for things that feel like they should work 2020-03-02 11:30:41 -05:00
Brown
2abe76d3c2 Fix assertion generation 2020-02-10 17:27:46 -05:00
Brown
d8f5ad190b Improve invalidation of inherited properties 2020-02-10 17:03:51 -05:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Matthew Brown
b5cbc84351 Fix #1617 - add option to only show errors in reports 2019-06-09 12:37:28 -04:00
Ilija Tovilo
5a14e4b1cf Progress bar (#1709)
* Revert "Revert "Implement better progress""

This reverts commit 4302596654.

* Revert "Revert "Implement dots progress bar""

This reverts commit e41733d789.

* Revert "Revert "Switch to VoidProgress by default""

This reverts commit 304ffeb0a3.

* Revert "Revert "Pass success flag to progress""

This reverts commit 62a690ee4e.

* Improve socket communication

* Use an underscore

* Add means to disable progress

* Add extra newline before progress bar
2019-05-30 10:30:41 -04:00
Matthew Brown
4302596654 Revert "Implement better progress"
This reverts commit 042070d0fd.
2019-05-27 13:07:02 -04:00
Matthew Brown
304ffeb0a3 Revert "Switch to VoidProgress by default"
This reverts commit 63b46be361.
2019-05-27 13:04:38 -04:00
Ilija Tovilo
63b46be361 Switch to VoidProgress by default 2019-05-26 23:18:48 -04:00
Ilija Tovilo
042070d0fd Implement better progress 2019-05-26 23:18:48 -04:00
Ilija Tovilo
5d51680e65 Remove useless echo from tests 2019-05-23 14:32:07 -04:00
Brown
0bd4dbcbc4 Bump to PHP 7.1
Fixes #1650
2019-05-16 18:36:36 -04:00
Brown
ff14f671b1 Add hopefully-more-portable method for evaluating method/property usage 2019-04-16 16:07:48 -04:00
Matthew Brown
c772914910 Add some formatting 2019-03-23 14:27:54 -04:00
Bruce Weirdan
ec85096c96 Fixed identified issues 2019-03-02 08:43:19 -05:00
Matthew Brown
a6755cc523 Fix default test versions to 7.3 2019-02-07 15:27:43 -05:00
Matthew Brown
194bb31221 Fix #204 - allow missing param types to be added with Psalter 2019-02-02 14:16:49 -05:00
Brown
2d22db4cb7 Clear up use of reloadFiles 2019-01-02 12:10:52 -05:00
Brown
74a8dde1bb Fix build 2018-11-15 18:39:59 -05:00
Brown
110ca66692 Namespace test providers under Internal cc @TysonAndre 2018-11-12 11:20:59 -05:00
Matthew Brown
4d79b61e93 Change _checker to _analyzer 2018-11-12 11:20:59 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Matthew Brown
7d12bfd2d1 Cache errors as well as info issues 2018-11-01 21:52:39 -04:00