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

169 Commits

Author SHA1 Message Date
feek
ec7876b8d6
feature: allow specifying memory limit (#3947) 2020-08-06 08:51:57 -04:00
Brown
6919e88423 Add performance logging under a --debug-performance flag 2020-07-30 15:30:19 -04:00
Brown
1e01e90fba Namespace base files 2020-07-22 15:57:24 -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
Jon Ursenbach
6aca4c169e
feat: adding a runTaintAnalysis option into the config (#3800) 2020-07-10 13:22:03 -04:00
Tyson Andre
80e46cdb13
Support generating multiple report files (#3776)
E.g. `psalm --report=report.txt --report=report.pylint`.
It may be useful to have both a machine-readable and human readable
report, e.g. during taint analysis.

Previously, psalm would generate neither report if the report option was
repeated.
2020-07-08 15:08:17 -04:00
Brown
8404fa0750 Allow use of a different baseline
Ref #3672
2020-06-25 17:31:03 -04:00
Tyson Andre
bee10a2eb4
Add a --debug-emitted-issues flag (#3637)
And support --debug-by-line in psalter and psalm-refactor.
Those were previously not supported in getopt()

Fixes #3634
2020-06-22 18:16:47 -04:00
Brown
81e2745cf1 Add more options 2020-06-22 11:24:38 -04:00
Mark Sch
9aa46221f6
Use pretty print for JSON reporting. (#3364)
* Use pretty print for JSON reporting.

* Use pretty print for JSON reporting.

* Use pretty-print option on CLI for BC.

* Change static:: const to self::

Co-authored-by: Matthew Brown <github@muglug.com>
2020-05-18 08:40:20 -04:00
Markus Staab
3f3a2267ea
send php native warnings/errors/notices on stderr instead of stdout (#3355) 2020-05-12 20:44:09 -04:00
Brown
370ffa28e4 Fix #3117 - invalidate all caches when composer lockfile changes 2020-04-12 11:41:37 -04:00
Brown
ee50542b8f Allow users to disable caching full files 2020-04-12 08:34:57 -04:00
Brown
4ef7cb50a5 Make Psalm faster when there aren’t any changes whatsoever 2020-03-31 22:22:34 -04:00
Brown
53612d0df6 Make --diff imply --diff-methods 2020-03-26 18:14:54 -04:00
Matthew Brown
7f9e6b893e Increase processor consumption 2020-03-06 13:13:18 -05:00
Matthew Brown
d3f8e80c4a Move reference map generation into separate file 2020-02-23 14:53:31 -05:00
Matthew Brown
320f3ec863 Update level config name 2020-02-17 22:43:13 -05:00
Matthew Brown
e48d2aef9c Improve handling when threads cannot be used 2020-02-17 22:06:36 -05:00
Matthew Brown
ced092874a Make config generation smarter 2020-02-17 22:05:58 -05:00
Matthew Brown
4e36f6caf5 Add explicit paths for included files
Fixes #2757
2020-02-07 09:06:15 -05:00
Philip Hofstetter
f6983fd883 allow setting php version from config or composer.json
if a composer.json is present and a PHP version requirement is
configured, we set the php version to the minimal PHP version that
satisfies the composer requirement.

Additionally, this adds a `phpVersion` attribute to the <psalm> tag. If
that's set, it takes precedence over what has been detected in
composer.json.

And finally, the --php-version command line flag continues to work and
takes precedence over the setting in the <psalm> tag

this fixes #2628
2020-01-30 08:48:53 -05:00
Brown
6b43c41ea3 Add file-defined functions 2020-01-08 17:40:50 -05:00
Brown
7482b9e56f Emit all stubs discovered by Psalm during analysis
Fixes #827
2020-01-08 17:23:40 -05:00
Tyson Andre
b713066d32 Add an exception handler that prints full exception trace (#2418)
By default, php will only print the first few thousand bytes of the
exception, for an uncaught exception
(I think that's the default, and not just my configuration)

Instead, print all of the parts of the exception.

For #1083 (this PR does not cover set_error_handler)
2019-12-04 23:17:08 -05:00
Matthew Brown
f667dee4f5 More logging 2019-12-03 00:06:00 -05:00
Matthew Brown
260b73ce78 More logging 2019-12-02 23:59:01 -05:00
Brown
821f3528d2 Fix #701 - indicate issues fixable with Psalter 2019-12-02 15:24:01 -05:00
Matthew Brown
952484c64d Add workaround for pcre.jit bug 2019-11-30 08:26:26 -05:00
Tyson Andre
6bc152e2da Use the long progress bar for CI logs (#2364) 2019-11-22 08:56:18 -05:00
Matthew Brown
dade56e4e1 Fix #2354 - add option to match documentation 2019-11-17 14:49:28 -05:00
Joram Schrijver
e79a0cc8f0 Make --init use vendor-dir from composer.json (#2313) 2019-11-08 06:59:04 -05:00
Tyson Andre
f40fe86321 Properly warn when a short option is invalid. (#2280)
Previously, Psalm would not warn or exit - it would skip over the arg and
continue with analysis.
2019-10-29 08:55:34 +00:00
Bruce Weirdan
1d9a4cd53e Show errors in progress bar when --ignore-baseline is specified (#2195)
Refs vimeo/psalm#2190
2019-10-01 20:28:42 -04:00
Brown
d225374d6d Fix #2156 - do better inference after isset 2019-10-01 19:31:08 -04:00
SignpostMarv
943705ce0e load an xdebug stub when required, re: vimeo/psalm#2118 (#2133)
* load an xdebug stub when required, re: vimeo/psalm#2118

* correcting case sensitivity of XDebug to Xdebug

* only load the Xdebug stub when needed
2019-09-14 10:13:39 -04:00
Matthew Brown
deb36e8b27 Allow array_map alone when it uses a closure 2019-09-09 21:28:56 -04:00
Brown
28a954e623 Fix #2108 - don’t worry if config can’t be found when updating baseline 2019-09-09 17:03:23 -04:00
Brown
a6baa2d04c Allow callables to be understood as pure
Fixes #2112
2019-09-09 12:11:04 -04:00
LeSuisse
0860727e64 Disable progress bar automatically when GitHub Actions is detected (#2043)
https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables
2019-08-22 15:28:05 -04:00
Matthew Brown
2a5e0d8f39 Fix #1444 - track unused suppressions 2019-08-18 14:27:50 -04:00
Michael Telgmann
5722512180 Fix setting of current_dir with 'root' command parameter (#2001) 2019-08-11 15:12:18 -04:00
Matthew Brown
b2c0993cdc Add framework for taint analysis to Psalm
Ref #611
2019-08-04 10:37:36 -04:00
SignpostMarv
9ac78b5d10 add psalm config attribute re: #1804 (#1936)
* add psalm config attribute for controlling the default inclusion of php & php extension version info in the error baseline

* using method recommended by @bdsl in https://github.com/vimeo/psalm/pull/1936#discussion_r302727993
2019-07-12 10:31:12 -04:00
Brown
73b1571bd7 Remove php version from default baseline generation 2019-07-11 10:41:44 -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
Barney Laurance
94f934627c Work in progress - resolve directories from config file location (#1904)
* Add resolveFromConfigFile config option

Treats all paths as relative to the location of the config file, not
the current working directory of the process.

This commit just changes psalm, further commits will be needed to
apply the change to psalter and the LSP server.

* Copy asset xml files into project root for testing, delete during teardown

Needed since paths are now resolved relative to the position of the
file.

Not sure why I only saw a test failre for 1.xml - would have expected it
for all eight files.

* Fix following rebase

* Move psalm --init handly code above working directory setting code

If there's no psalm.xml yet we can't use the location of psalm.xml to
set our working directory

* Move Psalm version output code above working directory resolution

Working directory doesn't need to be known to output version constant

* Rely on new config file based working directory in end to end test

* Dont use rely on config dir for --alter - not currently working

* Fix code style error

* Add failing test for supporting config without `resolveFromConfigFile="true"`

* Don't treat config directory as a path to check

* Document resolveFromConfigFile setting
2019-07-06 12:21:39 -04:00
Mikko Pesari
caf7737bbe Disable progressbar when GitLab CI is detected (#1867) 2019-06-28 11:25:29 -04:00
Mikko Pesari
3c61b17843 Exit with error status on baseline read errors (#1866) 2019-06-28 10:49:57 -04:00
Brown
e54f899858 Add pcre.jit message upfront when running Psalm on Macs
Ref #1855
2019-06-27 10:51:13 -04:00