1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-06 05:29:00 +01:00
Commit Graph

94 Commits

Author SHA1 Message Date
748a74bb2c Merge remote-tracking branch 'origin/4.x' into HEAD 2022-10-16 13:41:27 +02:00
Jack Worman
3b76ac85dc Count Report Format 2022-07-10 17:50:50 -05:00
Bruce Weirdan
94395f18a4
Applied JsonThrowOnErrorRector 2022-01-05 19:32:43 +02:00
ralila
6ee3d44092 Conversion of misc 2021-12-14 02:52:44 +01:00
rarila
39402c233d
Return type hints (#7065)
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
Bruce Weirdan
e9d9481ea6
Merge pull request #7060 from rarila/codingstyle-convert-fqn 2021-12-05 02:46:03 +02:00
ralila
8fb2e0f885 Handle some partials 2021-12-04 21:55:53 +01: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
245920e53c Import instead of using fqn 2021-12-03 20:11:20 +01:00
Bruce Weirdan
28a75652ac
Merge pull request #6997 from zoonru/list_values_paradox 2021-11-29 00:47:12 +02:00
Bruce Weirdan
ec1571d261
Adjust link test to account for colors 2021-11-28 01:14:03 +02:00
ee8c5c9c35
Remove some array_values 2021-11-26 21:47:17 +01:00
Bruce Weirdan
db181bfc08
Test links output 2021-11-14 23:07:00 +02:00
Bruce Weirdan
6610a2f918
Improve Github Actions output
* Use issue type in title
* Also provide issue type and location in the (use-visible) error message

Fixes vimeo/psalm#6817
2021-11-04 03:03:25 +02:00
Bruce Weirdan
abf557da44
Encode XML output consistently
This fixes test failures when running on PHP 8.1, due to changed
`htmlspecialchars()` defaults
2021-09-05 20:06:59 +03:00
Bruce Weirdan
76be96ce53
Drop FakeFileProvider from tests folder
And use Psalm\Internal\Provider\FakeFileProvider
2021-07-02 03:57:57 +03:00
Matt Brown
4a9f35f0a8 Update ReportOutputTest.php 2021-06-10 17:59:41 -04:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
orklah
ff0c1ce567
update hardcoded Psalm version (#5783)
* change hardcoded Psalm version to something more recent

* change hardcoded Psalm version to something more recent
2021-05-17 08:27:08 -05:00
Bruce Weirdan
aa854ae338
Link to SARIF JSON schema (#5718)
Fixes vimeo/psalm#5716
2021-05-05 21:47:36 -04:00
Bruce Weirdan
105c6f3a1c
Remove (and prevent) unused uses (#5704)
* Updates `slevomat/coding-standard`
* Removes unused uses
* Prevents unused uses
* Fixes a number of symbol case mismatches
2021-05-03 17:22:15 -04:00
Matt Brown
3046468d1e Add hints for MixedAssignment issues 2021-03-17 01:10:42 -04:00
Bruce Weirdan
97fe86c4e1
Fix BC break introduced in 4.6.3 (#5410)
Fixes vimeo/psalm#5405

Requires new patch release.

This PR reverts changes to the signature of `IssueBuffer::finish()` and
introduces separate method to be used to capture `$_SERVER`
2021-03-16 19:28:18 -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
Lukas Bestle
2d17b744ce
SARIF report: Include help links (#4924) 2021-01-03 01:45:21 +00:00
Lukas Reschke
494ec40777
Add SARIF as report output (#4582)
https://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html
2020-11-17 13:23:20 -05:00
Matt Brown
324e9d11c3 Fix tests 2020-11-08 11:04:39 -05:00
Matt Brown
14efde286f 4.x - refactor unused variable detection
This turns unused variable detection into an explicit control-flow problem, where before we had a more simplistic mark-and-sweep algorithm
2020-09-30 12:28:13 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -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
Brown
8ad1c2eeb1 Use immutable data structures for clause calculations 2020-08-26 10:41:47 -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
17558a5c0e Fix #3676 - add multiline output for TaintedInput issues 2020-06-30 13:17:51 -04:00
Brown
1cc53f1172 Fix tests 2020-05-14 23:22:49 -04:00
Anthony Rainer
6f36f33630
Added new language server options and functionality. (#3161)
* Added new language server options and functionality.

Added new extended diagnostic code information to the language server.
 -- It must be enabled via a command line switch.
Added telemetry data for language server initialization and operation.
Added verbose log messages for language server.
 -- It must be enabled via a command line switch.

* fixed phpcs issues

* fixed failing tests

* changed the language server reported error code to be the help link

Co-authored-by: Anthony Rainer <0@0ze.ro>
2020-04-17 00:47:18 -04:00
Brown
001f064bd4 Don’t modify contents of IssueBuffer in baseline before caching 2020-03-31 23:38:58 -04:00
Matthew Brown
4e07dfebaa Make link part of IssueData so it’s available to all consumers 2020-03-19 16:22:43 -04:00
Ben Dusinberre
732cffc82c Update test for info level change 2020-03-08 20:18:35 -05:00
Ben Dusinberre
15ea7bf357 Remove the rest of the invalid attributes 2020-03-08 20:18:35 -05:00
Ben Dusinberre
783dbfae9c Remove duplicate testsuite element 2020-03-08 20:18:35 -05:00
Ben Dusinberre
ef1d2e5436 Validate junit output against xsd 2020-03-08 20:18:35 -05:00
Matthew Brown
6a4e7931e6 Fix tests to add new property 2020-02-17 16:43:50 -05:00
Matthew Brown
6d088f2396 Even more commas 2020-02-16 18:43:54 -05:00
Matthew Brown
196a0a5c4e Replace issue data array with object 2020-02-16 18:24:40 -05:00
Bruce Weirdan
a23dd9f97d Fixed vimeo/psalm#2792 2020-02-11 22:21:54 -05:00
Matthew Brown
d7b99148be Add support for JUnit report type
Fixes #2485
2019-12-19 20:18:09 +00:00
lhchavez
216f991b0c Normalize stringified type names (#2239)
This change makes stringified types more normalized. Concretely it sorts
all union types, reconciled types, and sorts the keys within object-like
types.
2019-10-17 01:14:33 -04:00
Barney Laurance
ea83068deb Allow resolving directories from config file location (continued) (#1910)
* Extract function getPsalmHelpText() from psalm.php

* Extract initialiseConfig from psalm.php

* Add -c as valid short option for psalter and psalm-refactor

* Use initialiseConfig in psalter, psalm-refactor and psalm-language-server as well as psalm

* Rely on psalm --alter resolving directory from config file in test

* Remove erronous condition for config file path

This code was based on me wrongly thinking that the config file location
was seprated from the argument name with a space instead of an equals
sign

* Use config dir as current dir in psalm and psalm-refactor, as with psalter and psalm-language-server

* Remove redundant duplicated code

* Refactor: move calls to \Psalm\Config::setComposerClassLoader inside initialiseConfig

* PHPCS fix

* Extract function get_path_to_config from command scripts

* Refactor - extract functions from \Psalm\Config::loadFromXML

* Refactor - reduce verbosity of config loading code

* Allow running e2e tests on windows

* Fix testCompactReport on Windows

* convert line endings to make testCompactReport pass on Windows
2019-07-07 08:55:53 -04:00